Automatic Row Push?

I'm using Yanfly's Row Formation plugin, and my game features three rows: The front row, the middle row and the back row. The back row in particular cannot be targeted by most damaging skills, and here resides the problem.
Since i'm experiencing problems with balancing the game to work with three rows like that, is there a way to make so, when all the battlers of a row collapse, the battlers that are in a further row move forward to occupy the empty row? For example, if all the battlers in the front row collapse, then the battlers in the middle row go to the front row, and the battlers in the back row go to the middle row.
Thanks in advance.
I've moved this thread to Plugin Support. Please be sure to post your threads in the correct forum next time. Thank you.



Please link to the plugin you're talking about, you can't expect everyone to know it
Fair enough
http://yanfly.moe/2016/01/02/yep-54-row-formation/
One of Yanfly's newer plugins is the Selection Control that lets you set skills to only attack the front row or the back row. This would make the middle row the safe row because you would have to have a skill that specifically targets the middle row to be targeted (or hit all of course.) When the front row dies, the middle row now becomes the front row. and if the back row dies first, then the middle row now becomes the back row.


I know you said you want the back row to be the safe row but i'm not sure if thats possible. 
I was trying something similar that would move all from the previous line forward if all in the first where gone, but I could only get it working for one enemy at a time. I deleted it, but I will try to remake it. You would use the BuffsStateCore's <Custom Turn Start Effect> tag in the row state for that row and a conditional to check how many members are alive in the row in fount of it. If members of the next row is less than what you would have as the maximum then it will move an actor to the next row.


Edit: Here is one that detects and distinguishes between actor and enemies. It will advance an actor from the row this state is applied to. This will move an actor or enemy to row one if there are zero actors in the front row. You can change the "=== 0" part to match your needs for the number of actors needed alive in the row to make this activate. Increment "1" to what ever row you wish battlers to move to.

Code:
<Custom Turn Start Effect>
if (user.isActor()) {
 if ($gameParty.rowAliveSize(1) === 0) {
  user.setRow(1)
 }
}
else {
 if ($gameTroop.rowAliveSize(1) === 0) {
  user.setRow(1)
 }
}
</Custom Turn Start Effect>

Original thread: https://forums.rpgmakerweb.com/threads/automatic-row-push.61077/