I seem to have accidentally posted it on the FEBuilderGBA thread.
I made a patch.
Add Event: GetUnitDistance
It provides you with the following instructions.
EVENTSCRIPT:1.en=400D0000{$L1:ASMC_GetUnitDistance.dmp} Get Distance between Units in Slot1 and Slot2(LOW) @STOREC {COND}
EVENTSCRIPT:2.en=40050100XXXXXXXX40050200YYYYYYYY400D0000{$L1:ASMC_GetUnitDistance.dmp} Get Distance between Units in [XX:UNIT:Unit1] and [YY:UNIT:Unit2] @STOREC {COND}
EVENTSCRIPT:3.en=40050100FFFFFFFF40050200YYYYYYYY400D0000{$L1:ASMC_GetUnitDistance.dmp} Get Distance between Units in CurrentUnit and [YY:UNIT:Unit] @STOREC {COND}
EVENTSCRIPT:11.en=400D0000{$L1:ASMC_GetUnitDistanceCoord.dmp} Get Distance between Unit of Slot1 and Coordinates of SlotB(LOW) @STOREC {COND}
EVENTSCRIPT:12.en=40050100ZZZZZZZZ40050B00XXXXYYYY400D0000{$L1:ASMC_GetUnitDistanceCoord.dmp} Get Distance between [ZZ:UNIT:Unit] and Coordinates of [XX:MAPX:X][YY:MAPY:Y] @STOREC {COND}
EVENTSCRIPT:13.en=40050100FFFFFFFF40050B00XXXXYYYY400D0000{$L1:ASMC_GetUnitDistanceCoord.dmp} Get Distance between CurrentUnit and Coordinates of [XX:MAPX:X][YY:MAPY:Y] @STOREC {COND}
sample
As a measure against covid-19, we will carry out a social distance between the ally.
Please leave at least 2 spaces between player units.
If the units approach each other, Zeth will get angry when they wait.
In addition, only the prologue is made.