Common event when all enemies statused

I think the title itself it's already a good explanation hehe!
How could I trigger a common event during a battle when all the enemies have a certain status?
For example, if you get to burn all the enemies at the same time, a common event triggers with an explosion that causes damage to all the enemies. Do I need a plugin to do that or it's enough with what rpg maker mv provides me?
Thanks
You can do this with checks inside the troop event. Making it a standard for all battles you will need a plugin like Yanflys Base Troop Event.
You can do this with checks inside the troop event.
How? The only way I can think of would be to have the skill that applies the status set a switch, which can then be checked for inside the troop event, see if the entire troop has it and toggle the switch back if not, but that's super cumbersome.

How could I trigger a common event during a battle when all the enemies have a certain status?
I would recommend using a plugin for it. Yanfly has a few that would work - the Buffs & States Core lets you specify a Custom Apply Effect that runs whenever the state is applied to a battler. Her Action Sequences also allow you to run code during a skill's activation.

Using an action sequence is more of a learning curve, but also is ultimately more flexible; using the Custom Apply is simpler, but you'll have no control over when within the skill it activates.

Either way, the code works the same way.
How? The only way I can think of would be to have the skill that applies the status set a switch, which can then be checked for inside the troop event, see if the entire troop has it and toggle the switch back if not, but that's super cumbersome.
I was thinking with something like this:

$gameTroop.aliveMembers().every(function(member) { return member.isStateAffected(X) })

I haven't tested this though so I could be wrong.
I was thinking with something like this:
The code is not the question - the event condition is the question. You wouldn't want to wait until the end of the turn to check, you'd want it to happen as soon as the last enemy gets the state.

That's not going to have any correlation to either actor or enemy hit points, either, so the only remaining trigger condition is, as I first mentioned, playing with a switch.
The code is not the question - the event condition is the question. You wouldn't want to wait until the end of the turn to check, you'd want it to happen as soon as the last enemy gets the state.
That's a good point, I wasn't even considering the timeframe for when the trigger would happen.
How? The only way I can think of would be to have the skill that applies the status set a switch, which can then be checked for inside the troop event, see if the entire troop has it and toggle the switch back if not, but that's super cumbersome.


I would recommend using a plugin for it. Yanfly has a few that would work - the Buffs & States Core lets you specify a Custom Apply Effect that runs whenever the state is applied to a battler. Her Action Sequences also allow you to run code during a skill's activation.

Using an action sequence is more of a learning curve, but also is ultimately more flexible; using the Custom Apply is simpler, but you'll have no control over when within the skill it activates.

Either way, the code works the same way.
is there a way to force skill or playing common event with yanfly buff & states core ? i kinda want to make custom react effect with skill activation but i have no idea what to add except target.animation

EDIT : Nevermind i already found the solution , thankyou .

Original thread: https://forums.rpgmakerweb.com/threads/common-event-when-all-enemies-statused.138261/