Event not running on final hit in combat

I currently have a setup I'm working on where stats are increased by actions instead up level ups. I got it working so far that the attack increases each time the actor attacks, but the issue I'm having is that the event doesn't run when the final hit of the battle takes place and I'm not sure why. Any help is appreciated.

I'm new to RPG Maker MZ and not wanting to dive right into scripting myself so I was glad I could make it work as far as I did without adding scripts, just trying to understand why it doesn't run at the end of combat.
It's because the battle end phase takes priority over events.

It is possible to work around that using an "Immortal" state (with a "State Resist: State 1" trait). In your case, though, to affect every battle, I'd suggest seeking out an appropriate plugin instead.

I haven't tested, but looking at its code, I think this plug-and-play MV plugin should work in MZ:
Otherwise maybe someone else knows of something written specifically for MZ~
the solutions above are all for troop events, but the OP is using a common event attached to a skill.
that will not work because by default the common events are processed last, and the immortal trick would still end the battle before that.

the end phase triggers might work, but would require an additional troop event to do something after the regular turn end, and that is also tricky.


so the best solution would be to adapt action sequences and have the common event moved into the action sequence of the attack skill.
That will need a plugin for action sequences, but solve all other problems directly.
I just tested in MZ the plugin I linked, and it correctly addresses the issue, plug-and-play. The event type does not matter, because they're all processed by the same method. Reserved events like you're using (from an effect on a skill/item) will, as usual, get priority over troop events.

Like Andar says, "action sequences" (e.g. from VisuStella Battle Core,Akea Animated Battle System, or similar) could also work.
by default the common events are processed last, and the immortal trick would still end the battle before that.
That's not correct. The attacking skill will finish its resolution, including its common event, before a troop event is triggered by the enemy being at <= 0% HP.
I just tested in MZ the plugin I linked, and it correctly addresses the issue, plug-and-play. The event type does not matter, because they're all processed by the same method. Reserved events like you're using (from an effect on a skill/item) will, as usual, get priority over troop events.

Like Andar says, "action sequences" (e.g. from VisuStella Battle Core,Akea Animated Battle System, or similar) could also work.
That worked beautifully thanks a ton. I was worried I would have to just leave it as a minor inconvenience bug or something.

Original thread: https://forums.rpgmakerweb.com/threads/event-not-running-on-final-hit-in-combat.173654/