Keep boss alive until minions dead

 It is important that the boss is the last to die.  Within the story and the cutscene that follows a particular battle, I cannot afford to have the player kill off the boss before the end of the battle.  I know that I could give him the 'immortal' state until he reaches 0HP, but that point could be reached while other enemies are still alive, so won't suit my purposes.  Also, I don't want to do it by giving him insanely high HP because if the player succeeds in getting rid of the minions fairly quickly, that just leaves a long and potentially boring slog until he too is killed.

[SIZE=10.5pt] [/SIZE]

[SIZE=10.5pt]What I want to happen is that he is basically undamaged until the minions are dead.  I can do that by giving him a state where he takes no physical or magic damage.  However, I can't work out how to remove that state when the last minion dies.  There are 3 of them.[/SIZE]

[SIZE=10.5pt] [/SIZE]

[SIZE=10.5pt]What I have thought of so far is this in this Troop event in a test project:[/SIZE]

[SIZE=10.5pt]
Troopevent_zps4ce1828d.png
[/SIZE]

[SIZE=10.5pt]I have tried putting the conditional branches onto a second page, it makes no difference, the state persists.  I have tried the second page with and without a condition.[/SIZE]

[SIZE=10.5pt]Could anyone point out where I'm going wrong?[/SIZE]

[SIZE=10.5pt]thanks.[/SIZE]

[SIZE=10.5pt][/SIZE]
I don't normally play around with battle events, but it looks like the condition makes it so it only triggers on turn 0. Try Turn [ 0 ] + [ 1 ] *X

This should make it so it's checked every single turn.

edit: also change the span to Turn
Perhaps I'm missing something, but couldn't you just set the condition as the minion's hp being 0, for the state being removed? If you have a couple of minions, have two identical states with different names, and each minion dying takes away a different one.
@seita

You are my hero of the day!  It was having the turn just at 0 which was the problem.  Changing that means it works exactly as I had hoped.

@LanceGardner, I had tried the minion HP at 0 but it hadn't worked - probably for the same reason, as that too was set to turn 0

Thanks guys.
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/keep-boss-alive-until-minions-dead.23000/