Sensing when specific enemies are dead?

So I have something in my project I'm making where I need to defeat a specific 2 enemies and then the main enemy gets a debuff/gets a new skill, is there some way to sense when 2 specific enemies are slain?

Currently I have it so when each enemy are taken out it makes a variable count up (1 per enemy) and when the variable reaches 2 it activates what I'm trying to achieve, but it's messy and inefficient...

Again, just to avoid confusion, I'm looking for how to detect when enemy #2 and #3 are slain, Not enemy #1
A basic approach could be to add a check for "is the other guy also dead?" in each troop event. However, I think in general you would need some form of switch or variable counter to avoid applying the effects twice in the case that they both die at the same time (e.g. AoE damage).

Personally I think I'd use a "do once" switch here as an extra troop event condition:
  1. Battle start - Condition = Turn 0; turns on switch 123.

  2. Minion A - Condition = Minion A HP <= 0% + Switch 123 is ON; contents:
    • If {Minion B} is affected by state #1 (death/KO):
      • Proc effects on main enemy.
      • Turn off switch 123.

  3. Minion B - Condition = Minion B HP <= 0% + Switch 123 is ON; contents similar to A.
All of these troop events would have Span = Battle, i.e. run once per battle the first time their conditions are met.

This would also allow you to either check the value of the switch after battle ends (to see if the special effects were skipped) or, alternatively, to reuse that switch in other battles for similar purposes~
Thank you for the detailed response, I found it was very insightful however I just found using a few conditional branches at the end of a turn fixed my issue and I don't have to use variables 🙂

Thanks for the and help I appreciate it!

Original thread: https://forums.rpgmakerweb.com/threads/sensing-when-specific-enemies-are-dead.181435/