How can I make optionnal enemies?

Sorry if I don't post this at the right place.
I would like to make enemies whose death is not essential to finish the fight. (like pillars in a cave, etc.) Those enemies can be killed in battle, but if you kill all the "real" enemies the battle ends.
I know there are plugins to run a common event at the death of an enemy, but is it possible to make some enemies optional?
(and excuse my bad english please...)
This should help:
@ATT_Turan has some nifty pieces of code.
You could have a troop event set to abort the battle when a specific enemy reaches zero HP, and then have a switch that'll trigger some event when that happens. It would look something like this.
1748629972637.png

1748629942855.png
Thanks! this plugin is exactly what I was searching for.
You could have a troop event set to abort the battle when a specific enemy reaches zero HP, and then have a switch that'll trigger some event when that happens. It would look something like this.
The only problem with this approach is that you don't get any XP for the battle. It's as if you escaped rather than won.
The only problem with this approach is that you don't get any XP for the battle. It's as if you escaped rather than won.
Good point, ya won't get xp from the battle. You could do a ChangeEXP event to make up for it though : D
For what it's worth, this can also be done with my Alt Death States plugin. It does the same thing as the code linked in the other thread but is a tiny bit fancier about it and connects it to a state rather than a note tag.

Original thread: https://forums.rpgmakerweb.com/threads/how-can-i-make-optionnal-enemies.178038/