Temporary skill using items

Hi, sry if this is not the correct place to ask this.

I'm working on a game were a potion (item) will give the actor the ability to temporarily have a skill (ie till the end of the battle and then disappears). For example : the actor drinks potion X and receives the skill "Dragon Breath", throws huge fireball at opponent, but once the battle is over he doesn't have the skill anymore.
I am not sure how to go at it, can anybody help ?
have the potion give a state, and have the state contain the traits for giving the skill.
as long as the state persists the actor can use the skill.

make sure the state gives both skill and skill type unless the actor already has the skill type
you could also create a common event that runs at the end of every battle and then remove the temporary skills in that common event. That event could then also be used for other stuff that happens at the end of a battle.

Then, simply have the item teach a new skill and boom. 😛

If that skill can also be learned permanently you may want to work with switches as well. So essentially, the item activates a common event that checks, whether the skill is not learned. if so, it teaches the skill and activates the corresponding switch. Then, after battle, the other common event fires and if the switch is activated, it removes the skill and deactivates the switch. That will make it that after actually learning the skill you will no longer forget it.

But yes, states + common events is generally a good way to implement hidden mechanics. Just make sure to assign no icon to the state so that it isn't actually visible to the player.
Thank you both, it helps a lot.

Original thread: https://forums.rpgmakerweb.com/threads/temporary-skill-using-items.148468/