An event that checks a variable after each battle.

I currently have a variable for each enemy that increases by 1 for each one killed in battle. (Effectively creating a kill count). And I want the player to be rewarded once they hit a certain kill count number. My first thought was to create a parallel process on each event that would check the variable, then erase the event. But, I don't think it would update after each battle. My next thought was to use a common event that checked the variable, but I've no clue as to where to place it.

Questions:
To make sure that they event doesn't continuously reward the player, would it work to place a switch in the event that turns on after the reward is given. Then the switch would send it to the next event page?

How do I make it so it checks the variable directly after each battle?
Make a common event parallel process conditioned to a switch "after battle".
Inside that event, do whatever you want to do after the battle, but switch off that switch as the last command.
And then add a troop event to every battle that turns in the switch at first battleturn.

Parallels don't work while in any screen, so the common event will only activate after leaving battlescreen even if switched on at the beginning of the battle.
make your processing event, and hook up onto a call to $game_party.on_battle_end:
Code:
class Game_Party < Game_Unit
 alias orig_OBE on_battle_end
 def on_battle_end
  orig_OBE
  $game_temp.reserve_common_event(id)
 end
end

when you return to the map scene, whatever event is reserved will run before any on-map events.
Make a common event parallel process conditioned to a switch "after battle".
Inside that event, do whatever you want to do after the battle, but switch off that switch as the last command.
And then add a troop event to every battle that turns in the switch at first battleturn.

Parallels don't work while in any screen, so the common event will only activate after leaving battlescreen even if switched on at the beginning of the battle.
Thanks, my way was much more complicated. Yours worked perfectly.

Original thread: https://forums.rpgmakerweb.com/threads/an-event-that-checks-a-variable-after-each-battle.96584/