Ah, I haven't used the plugin, I presumed they were user-defined. Then just use the code I gave you, and only actors will get affected by it. But then, if it were me, I would want the state saying what row someone is in to be separate from a state that actually does things (such as Protected).
Or you could give your enemies the notetag <Default Row: 1> and <Row Lock>. Or whatever else you like.
What result do you get from checking the variable in the console when you've killed off the front row?
Is there a reason you're using the plugin parameters reserved for old versions of RPG Maker?
You must think I am the biggest noob ever now, but I don't actually know how to check for variables in the console... I only ever used it to se if something would trigger an error.
Regarding the plugin parameter version 1.5.0+:
They both do the same thing but if you are running a version of RPG Maker MV that is version 1.5.0 or higher you can select the states from a convenient drop down list rather than typing them out.
I have tested it a bit more and I don't think using the <Custom Row Condition> Function is going to be the answer. If I use the code that you so kindly offered it will still apply or remove from both Party and Troop at the same time. I think its just the nature of how "Row States" that are defined through the plugin parameters work. I don't know if there is a way to add a state to an entire row via script call? This might be a different angle to solve the problem.
I have used the Row Formation plugin for a little while now and became quite familiar with it. I just never tackled the Java Functions... However together with Yanflys Selection Control plugin I actually managed to create a tactical combat system that I am quite proud of...
Melee Weapons can only hit the front row, ranged weapons can target any row, skills that can push or pull enemies into different rows etc. As my coding knowledge is still limited I mainly used eventing and a combination of notetags to achieve this. I am quite happy with it but there was always one thing that bugged me and I could never work out how to do using eventing or notetags...
Imagine you have two enemies in the front row. As long as they are alive melee weapons would not be able to target any enemies in the rows behind. But what if both of the enemies in the front row were to be stunned, frozen, asleep or petrified (essentially "Disabled")
At this point It wouldn't make sense that melee weapons could only target the front row. They should be able to target the 2nd row as well as enemies in the front row wouldn't represent an active threat at this point. But once at least one enemy in the front row is no longer "Disabled" the 2nd row will be protected again and melee weapons cant target it.
I sort of managed to achieve it with some ridiculous troop eventing but it becomes almost impossible once enemies or actors start moving between the rows. Hence why I started to look at the functions provided in the row formation plugin...