(PS4) Adding a variable after monster death

Okay, so I've been hitting a brick wall on this one. Just recently got the game and have been pleasantly surprised on the versatility since RPG Maker on PS1 (my last RPGM game).

Anyway, I've been trying to make a "guild" system with a quest to kill 5 of a specific type of monster (for ease let's say "slime").

I created switch for the quest (let's call it "Guild").

I also created two variables. (The first is "Kills" and the second is "Completion")

Upon accepting the quest, "Guild" is turned on and "Completion" is set to 1.

In the troop screen, I created a second page with the following conditions:

[Turn 0 ~ 0] & [Switch "Guild"]
[Battle]
And the script:

Change enemy state: #1 Slime +Immortal
I then make a third page with these conditions:

[Enemy HP: #1 Slime 0% or below] & [Switch "Guild"]
[Moment]
and the following script:

Control Variable "Kills" += 1
Change enemy state: #1 Slime -Immortal
In theory this should allow the "Kills" variable to increase by 1 every time I kill the slime, so long as the "Guild" switch is on. After 5, I have an event set up on the map to inform the player that the requirements are met and to get the reward from the guild officer (where the "completion" variable matters and to turn off the switch)

In practice, when I kill the slime, the immortality works fine. Something happens under the hood and then the immortality is removed and the slime dies. Then the game freezes and I when I check the variable "Kills" which should be at "1", it is at some ridiculous number like "689".

I've also tried to "exit event processing" after the immortality is removed, but that doesn't work either.

Anyone have a clue what I'm doing wrong?

EDIT: I've solved it. I changed the span "Moment" on page 3 to "Battle". And this seemed to almost work, but it also looks like I had "Turn End" checked on in the conditions, which was causing the slime not to die immediately, so I turned that off. Finally, just to be sure, but probably unnecessary, I added a state before the rest of the script on page 3, that is an incurable "paralyze" state just to be sure that the enemy doesn't move before death - since at this point it was hours of head scratching and I was paranoid.

Now everything works like a dream.

Original thread: https://forums.rpgmakerweb.com/threads/ps4-adding-a-variable-after-monster-death.129239/