Magic that requires a certain item

So in my game I dont want characters to have MP.

They will equip items that teach spells.

Example: Fire Ring grants Fire, Fire 2, Fire 3

But in order to use those spells I want it to where the party has to have crystals. In this case Fire Crystals.

Fire = 5 Fire Crystals

Fire 2 = 10 Fire Crystals

Fire 3 = 15 Fire Crystals

Is there a way I can set this up through common events/variables?
There are a few details of what you might want missing, so the following may not be what you are looking for.  The simplest might be to have a common event to make the item.  Thinking quickly I can only come up with a way which would require a new ring to teach higher level skills.  Would that do you?

"Do you want a Fire Ring 1?"

Yes/No

If yes,

A variable checks how many Fire Crystals are in the inventory.

If 5 or more - Remove 5 and add a ring

If less than 5 - You do not have enough crystals.

When you make the ring, have it call a common event which teaches the skill.  That would be permanently learning - in which case, why do it with an accessory?  You could do it direct with the NPC offering to teach you if you have enough crystals.  If you do it just as I've outlined, anyone could learn the skill.  If you want to restrict the skill, then if you are using gear, you have to set the ring to a weapon type that only certain classes have.  For example, create the weapon type "Mage" and only allocate it to the person who want to use this sort of skill.  If it is being taught direct, then it will have to be through a conditional

Character X is in the party?

Yes/No

If Yes, teach that character the skill

If No, I'm sorry I see no one who can learn that skill  (in which case, you will have to return the crystals to the player's inventory).

If, however, you want the skill to be active only when the ring is equipped, then you will need a script, maybe something like this.  Your problem then would be that to learn and use Fire 2, a different ring would have to be equipped, and in that case Fire 1 would not be available if wanted.

Original thread: https://forums.rpgmakerweb.com/threads/magic-that-requires-a-certain-item.37603/