Item used to learn skill or use skill.

First, thanks for helping a newbie.

I want to make a magic scroll item that once used, depending on where, will learn a skill when not in combat, or will cast the spell (whether or not the actor has the spell) while in combat.

This is how I figure the logic should be for a common event that the item would have:

If (User is in Combat) 

Casts spell on that scroll.

Else

If (User has Spell)

"You already have learned that spell."

Else

User learns spell

At least I'm pretty sure I can use a common event, but I can't find anything that would reference whether the user is in combat at that moment.

Also I am afraid that I might have to create two items for each spell I want learned this way: One for learning the spell, and one for using the item to cast the spell. Is that what might have to happen?

Thanks!
Hi. On your troops page. Make a tab set to turn zero and a switch combat=on and timing set it to battle, then on a separate tab put when enemy hp=0 switch combat=off.

Original thread: https://forums.rpgmakerweb.com/threads/item-used-to-learn-skill-or-use-skill.52241/