Help implementing a Row system

So I want to have a front row/back row type system in my project. The rows themselves are just states that can't be removed and auto apply at combat start. I'm using the yanfly Row plugin for this, which also has some handy things like adding the row options to the various menus.

However, I want there to be a maximum of 3 party members in any given row at a time, and as far as I can tell there's no option in-plugin to do this. Given that a row is just an auto-applied state, how can I implement this limitation?

my current idea involves using a event of some sort thats checking how many members of the party have x state and if it's above 3, not letting the player exit the menu until the discrepancy is fixed, which should be an easy conditional branch if I can just get into the code for the row menus somehow.
I created a quick solution for someone who I believe wanted pretty much the same thing as you in this thread a while back by making some minor edits to the plugin code for the row formation menu. It has some limitations that I listed in the thread (and potentially others I am not aware of), so it may not work perfectly for your game, but hopefully it is at least a step in the right direction.
I created a quick solution for someone who I believe wanted pretty much the same thing as you in this thread a while back by making some minor edits to the plugin code for the row formation menu. It has some limitations that I listed in the thread (and potentially others I am not aware of), so it may not work perfectly for your game, but hopefully it is at least a step in the right direction.
Hey this is perfect! Thanks!

Original thread: https://forums.rpgmakerweb.com/threads/help-implementing-a-row-system.152384/