Yanfly learn skill engine

Using this script I have all the skills to be able to be learned by JP through the menu. I have another system that upgrades spells based on usage. Each spell has a variable tied to it and each cast calls a common event that adds +1 to that variable. When said variable hits a constant # the common event makes the actor forget the rank I spell and learns the rank II spell. 

Now the problem I am having is when the rank I spell is forgotten, it becomes available to purchase again with JP. How can I make it so rank I spells (after they've been purchased with JP) won't show up as an item to be learned OR show status as "learned" in the JP menu?
bump
Really need some help with this. As it stands, my game won't work the way I want it to.
as I look on the linked site, one of the instructions says you can set up a switch to be required to learn the skill.

<learn require switch: x>why don't you use it the other way? if your character learns the rank II skill, toggle the switch OFF for the rank I skill, so it is not available in the learn skill menu.

I didn't test that, but I would try this.
Wouldn't this require an individual switch for each spell? Is there another way to do it?
Wouldn't this require an individual switch for each spell? Is there another way to do it?
Probably. I'd just use switches 4001 to 4999 for that purpose then.
Couldn't you use the <learn require eval> tag to specify the condition for not showing the skills?

Edit: Turns out you can!

Put this in the notetag for level 1 of the skill (the one you can learn from the menu):

<learn require eval>

[email protected]?($data_skills[id of level 2]) && [email protected]?($data_skills[id of level 3])

</learn require eval>

 

This assumes a 3-level skill. If you have fewer, you only need the first bit. If you have more, just add more && conditions.
Couldn't you use the <learn require eval> tag to specify the condition for not showing the skills?

Edit: Turns out you can!

Put this in the notetag for level 1 of the skill (the one you can learn from the menu):

<learn require eval>

[email protected]?($data_skills[id of level 2]) && [email protected]?($data_skills[id of level 3])

</learn require eval>

 

This assumes a 3-level skill. If you have fewer, you only need the first bit. If you have more, just add more && conditions.
!! That's awesome. Thanks. There are 5 ranks of each skill. Rank 1 can only be bought from the menu with JP. Using that tag is that all I need to do?

Update:

When I add that notetag to any rank 1 skill I get the error attached.

1.png
What are you actually putting in the square brackets? I only put "id of level X" as a helpful message to you; it should only contain the number for the skill's ID.
/facepalm duh. lol. Thanks!

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-learn-skill-engine.37561/