Enemy Repositioning with Enemies that Appear Halfway through.

Hi,
I am rebuilding an old mobile game in RM. In this game you fight in a 3v3 style. Once an Enemy gets defeated the next enemy in line thats waiting in the battle queue will join the battle.
Unbenannt.PNG

So far I managed to place the first 3 enemies correct in line using this Script Call:
$gameTroop.members()[0].battler().setHome(x, y);

However things gets complicated once an enemy gets replaced via death. I need a way to force the game to always spawn the new monster at the spot were the other one died.
While I haven´t found any/searched for any Plugin that can handle 18 Troopmembers yet, this function has to also work on high numbers like that. (Note: There Enemies can spawn with Troop Members between 2- 18 this depends on the troop itself)

Original thread: https://forums.rpgmakerweb.com/threads/enemy-repositioning-with-enemies-that-appear-halfway-through.132324/