Trouble setting a variable to denote escaped battle

OK here is what I have so far

◆Battle Processing:Goblin*2
◆If:heroEscaped ≥ 0
◆Wait:60 frames
◆Control Variables:#0035 heroEscaped = 0
◆
:Else
◆Control Self Switch:C = ON
◆
:End
I've been looking through the forums for this but haven't found anything yet. I got the monsters patrols working and if they see you they react and chase you down and jump into combat all through a common event I can call from any monster but can't figure out the escape action.

The monster is a character figure on the map with auto follow on and when it collides a fight starts. if the hero didn't escape it should turn self switch c on therefore it's dead. If the player escapes it should wait 60 frames before moving to collide with them again.

I know it should probably just be a switch but I used a variable incase I want something else to happen from certain escaping which I can use different numbers for.

But my problem is I have no idea where to go to set this value. Do I really need to make this an event on every single battle? Though I don't even see a way to check for escaping in the battle code. Also escape doesn't show up as a skill. So I'm at a loss. Anyone have an idea on how to do this. I just want the enemies to not go away if you escape them and vanish if you kill them.
I think you might be overcomplicating things? The Battle Processing command has a Can Escape option. Enable that and you'll see separate branches for "If Win" and "If Escape":

◆Battle Processing:Goblin*2 :If Win ◆ :If Escape ◆ :End

This lets you easily decide what happens in each case. There's also a Can Lose option in case you want something special to happen instead of a game over.
Thank you I forgot to check can escape. This works so much better. I'll test it when I get home but pretty sure this will do it.

◆Battle Processing:Goblin*2
:If Win
◆Control Self Switch:C = ON
◆
:If Escape
◆Wait:60 frames
◆
:End
Great! Happy RPG Making~ 👋

Original thread: https://forums.rpgmakerweb.com/threads/trouble-setting-a-variable-to-denote-escaped-battle.138152/