After taking a short look into the sources of the other mod, I think the problem has its origin in the way it handles the upgrade - it replaces the existing turret by a new one with the new quality. Fortunately it raises an event when doing that and it should be possible to react to this event.