(help) Skill that learns/unlocks random skill then forget after combat

Hi! I've been trying to make a skill that learns random skill from a skill pool. Then I want the actor to forget any of the skills learned after battle.

Example:
- Actor uses Skill1
- Skill1 unlocks Skill2
- Actor uses Skill1 again
- Skill1 unlocks Skill3
- Actor uses Skill1 again
- Skill1 unlocks Skill6
- Actor now can use Skill2, Skill3, Skill6.

Then after battle, all skills should be gone (execpt Skill1).

I know how to do a common event for the random learning of skills. I just couldn't make it forget after the battle.

Thanks for your time!
You can have states have the player learn/forget skills. Just connect the skill to a common event, and increase the variable by a number, and under contitinal branches have it check the numbers on the variable. then, add/subtract states with the "add skill" trait added. be sure to check "remove at battle end" on the states. You can reset the variable in a parrelel process event on the map that erases itself

Edit: make sure the skill type of the skills learns matches one the actor can use
My suggestion would be to make a copy of any skill they can learn via this technique, and have the target learn the copy rather than the original skill. Then, at the end of battle, run a Common Event which makes all characters forget all of these 'copy skills'.

The ideal way to run a Common Event at the end of battle is to use a plugin, such as SumRndmDde's Battle End Events plugin.

If you can't use that plugin for some reason, then have every single battle in your game set a Switch to ON on turn 0. Create a Common Event which requires that Switch to be ON as its condition, and have that common event clear all the skills and then set that Switch OFF. This should cause it to run when you return to the map after any battle. But the plugin solution is way easier.
If they use the states option, they won't need to run a common event at battle end, sense states can automaticly remove themselves after battle, thus making the actor forget the skill
state_learnskill.png
Ok. Thanks guys! I will try both suggestions and get back here.
Thinking through @Oddball's solution, it's equally easy to mine, and probably a bit more flexible if you need control over the states during battle. I'd recommend it. Just be sure to set the States' Priority to 0, so that their invisible icon doesn't take the place of more important icons on the GUI (like buffs or poison)!
So I ended up trying Oddball's suggestion and it works! Then I looked into the Wavelength's suggestions and it gave me a new idea. Appreciated the help! Thanks again!

Original thread: https://forums.rpgmakerweb.com/threads/help-skill-that-learns-unlocks-random-skill-then-forget-after-combat.113874/