Yanfly Skills - Upgrade Skills

I'm making attempts to reduce the amount of clutter in my RPG skills. My RPG uses Yanfly's JP system for learning new abilities, but I also want to implement a system where you can level up skills by learning new ones that replace the original.

Here's an example of what I mean:

So the protagonist starts off with the base healing spell, Restore. However, I want her to be able to replace it with Restore II by learning it via the same method. However, in addition to the 200 JP requirement, it also requires two things: A specific item (Lv2 White Magic Scroll) and for Restore to already be learned. The item isn't an issue. However, not only do I not know how to implement the knowing the lv1 spell caveat, but I also want learning Restore II to remove Restore from the spell list.

Can someone help me with that?
Bumping this. I wasn't sure if it'd really be good to have the upgrades with their higher MP costs replace the original spell, but I don't think it'll be that big of a deal. After all, Final Fantasy II had a system where spells leveled up over time. And yeah, I know FF2 isn't exactly the gold standard for RPGs but hey, that was one aspect of the game I actually felt worked. If it doesn't... Should I just cut my losses and have every spell visible at all times?

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-skills-upgrade-skills.104999/