Using hex grid moved to generate what's left

World in flames games. Hex based movement. I have not implemented hex numbering.
Aircraft units can move, each hex moved costs 1/2/4/6 movements points depending on what map they are on. Fighters (ftrs) can be flown to provide CAP. A house option rule is that Fighters flying CAP can remain on a hex, with the CAP trait enabled, and may provide ftr CAP cover for more than the hex they are currently on. The house rule is that the ‘protected’ range is the ftr movement points minus the number of hexes used to move to the CAP hex divided by 2 (normal rounding rules apply).
ATM I use a trigger trait for the ‘owner’ to input this number (and turn on the area of effect trait). Is there a way to determine how many hexes have been used in moving to the CAP hex? If so I can replace the manual input with a calculated one.

If you’re allowing players to drag-and-drop counters (and therefore, move an arbitrary number of hexes at a time), then this would be difficult.

If your hex grid reports location correctly, it should theoretically be possible to compare the current location with the old location and determine the distance moved by triggering a key command from the map’s “Key command when piece ends movement on this map” function, and then increment a Dynamic Property appropriately (you would have to be careful to zero that DP before movement starts each turn). You should be able to google the correct algorithm for determining the hex distance between 2 hexes.

Alternatively, you could store the current hex location in one DP at the start of the turn, and then compare the current location to the stored location when the CAP function is activated to determine the total distance moved so far.

But honestly, this is really moving into ‘Custom java code’ territory.

As I am not going to get into custom java code, I think I will stick with the manual entry system. Thanks for your thoughts though.