question about the "change enemy state" function

I'm trying to make a troop event. There are 2 enemies in the "back" and 4 enemies in the "front." (I just positioned them accordingly in the troop layout). I'm giving a passive state to the "back" enemies which increases their evasion or stats in some way. I want to remove this state from both of them when all 4 "front" enemies are dead. Is there a way to do this using variables and further event functions?

I'm thinking maybe I need to make a conditional branch, and use a variable, that I increase every time one of the "front" enemies dies - and if/when the counter for that variable reaches 4, I do a "remove state" on the entire troop?

Thanks so much in advance for the help.
I'm thinking maybe I need to make a conditional branch, and use a variable, that I increase every time one of the "front" enemies dies
I don't see how that's helpful - there's no troop event condition for a variable.

If you're doing this solely with troop events and no plugins, you would have to make a separate troop event with the condition of each front enemy having <= 0 HP, then inside of it use conditional branches to check for the other 3, and if it's all true you Change State on the last two enemies.

Original thread: https://forums.rpgmakerweb.com/threads/question-about-the-change-enemy-state-function.173120/