Is there a way to set a switch at the end of battle?

Any battle, not just evented/scripted battles?

You see I'm trying to make a spell that teaches a char other spells during a battle, but I don't want said char to still have the spells in question after battle.

Edit: Whati I have an idea, can't I set a common event(autorun), and just use a condition branch(if char has skill, forget skill, or would common events set to autorun also go off during battles?

Nope, game freezes after I return to the world map sigh(damn after I saw I wasn't instantly forgetting the skill, I was sure it would work, but no).
set common event to parallel process, conditioned to a switch "after battle", removing all skills and other things from the actor.


Last Command in that CE would be turning the switch OFF to disable itself


Set the switch ON on turn 0 of the battle (in the troop events)


Finished


The battlescreen is a screen - and unless you install a special script, the parallel processes are stopped on all screens. Which means that turning on the switch on battlestart will NOT trigger the common event during battle, but it will start as soon as the battlescreen is left after the battle.
set common event to parallel process, conditioned to a switch "after battle", removing all skills and other things from the actor.

Last Command in that CE would be turning the switch OFF to disable itself

Set the switch ON on turn 0 of the battle (in the troop events)

Finished

The battlescreen is a screen - and unless you install a special script, the parallel processes are stopped on all screens. Which means that turning on the switch on battlestart will NOT trigger the common event during battle, but it will start as soon as the battlescreen is left after the battle.
Yea I beat you to it already lol, but thanks anyway.

After my edit, it hit me, talk about a dumb oversight(forgetting to turn off switch after forgetting the spell).
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/is-there-a-way-to-set-a-switch-at-the-end-of-battle.23013/