Instead of having a distance meter to trigger 'when in combat' have a combat timer that counts down since the last weapon fire. This will prevent the player from running away from the fight for a second to repair. Have it be like 15 seconds or something.