Having some trouble with manking things happen after using "Abort battle"

I'm trying to make it so if you lose this specific battle, you have the option to retry or not (Wich teleports you back to where you accepted the battle), but for both of these options nothing happens, the battle just ends and your left on the overworld with 1hp
Screenshot 2022-08-08 172711.png
View attachment 237123
Battle events cease to exist when the battle ends, so it has to be done on the map processing. I'd also like to note that this wont restore any consumable items, and reverting that to its previous state is a bit of a pain in the ass in vanilla (involving variables or arrays if that's within your skillset). However there is this.

If for whatever reason it must be done in-battle due to plugins being plugins, have a heal and all ailments/buffs removed occur, for both the party and the enemy.

Iavra also created this years ago:
I'll go ahead and link this recent tutorial as it seems relevant to what you want to do:

As already stated, Abort Battle does exactly what it says - you can't continue to run commands from a battle event when that battle is ended.

Original thread: https://forums.rpgmakerweb.com/threads/having-some-trouble-with-manking-things-happen-after-using-abort-battle.150255/