Boss battle help

I need help with a boss battle. I simply want the NPC to show up dead/injured after player defeats the enemy.
so far I have 2 opponents. At half health the first transforms to the second. That works. Once the second is dead I cannot get a switch to turn on to make the NPC event show dead.
I don’t want to use player can lose to make this happen in the NPC event. What am I missing in the enemies event?
I have tried if both enemies are less than 1% and 0%. if enemy is dead state for both as well.
Are you trying to set a self switch for an event via troop events in battle? If so, you can manipulate self switches via script using:

Code:
$gameSelfSwitches.setValue([mapId, eventId, a-d], newValue);

// so, for example, to set event 3 in map 42's self switch A to "ON" you'd use...

$gameSelfSwitches.setValue([42, 3, "A"], true);

// which can also be written as (with no spaces in the quoted portion)

$gameSelfSwitches.setValue("42,3,A", true);

Or of course you could try setting a normal switch instead of a self switch
It could be a self switch. I have a control switch I am trying to turn on within the troops battle event.
May first tab is if enemy is <\= to 50% for trigger. Everything in that tab functions. I transform enemy to a new enemy.
second and 3rd tab trigger is set to run if 1st/2nd enemy is less than 1% (also tried 0% and control switch from tab 1 is on) then within tab 2 an If: enemy name is state dead then turn on control switch.
it seems like my issue is that the enemy dies so the functions don’t run.
I even tried more basic. 1 enemy and if enemy is dead turn on control switch. Player wins battle and functions are ignored. I can attach screen shots soon. I have 3 tabs as I try all possible combos.
If the 1st enemy is still the main due to transform. Or if second enemy is used.
you can make an event battle so then you can turn a switch on after the battle
I think I will just put the control switch on in the first tab. If player dies it’s game over anyway.
If anyone has another solution I would love to learn the different way. I am trying to be as complicated (maybe overly) as possible to try an use more functions to learn and better understand the uses.

I need help with a boss battle. I simply want the NPC to show up dead/injured after player defeats the enemy.
so far I have 2 opponents. At half health the first transforms to the second. That works. Once the second is dead I cannot get a switch to turn on to make the NPC event show dead.
I don’t want to use player can lose to make this happen in the NPC event. What am I missing in the enemies event?
I have tried if both enemies are less than 1% and 0%. if enemy is dead state for both as well.
I might be a bit unclear on what you're trying to do. Are you just trying to make an event representing the enemy disappear after the battle? If so, then yeah just flip the switch after the battle. So your event page would just look like this:

- Some Dialog
- Battle Processing
- Set Self Switch A On

You don't even need to worry about troop events like that
Thank you for the feedback. I am overthinking it. I will save a control switch and just use the self switch.

Original thread: https://forums.rpgmakerweb.com/threads/boss-battle-help.132854/