Using skill learns a new skill

Is it possible to make a script so that when a skill is used a certain number of times it makes the user learn another skill?
I think Yanfly has a few scripts that will help toward that end - skills with conditions for learning, something like that...
A variable should be a viable condition for that, if i recall what I skimmed from the script correctly.
The only skill plugins I can find that look like something close from yanfly are the skill core and the skill learn system. But I can't see a way to configure them to do this?
Skill Core plugin can do this. For example, if you have a skill called "Fire I" and when you use it five times, you will automatically learn "Fire II". So to setup this, user <After Eval> note tag for "Fire I". This note tag runs after your skill is used, so put some pieces of codes there to increase value of a certain variable (or flag), and check if it meets the condition, let your actor learn "Fire II".

"Fire I" note tag:
Code:
<After Eval>
user._activationCount = user._activationCount || 0;
user._activationCount += 1;
if (user._activationCount >= 5){ //Change 5 to another number you wish. This is the number of times which skill is used
user.learnSkill(x);} //Change X to the skill ID you want to learn
</After Eval>

This is the only way i can think of. It does not look fancy, but it works.
Ah perfect. Just couldn't see how to set it up. Thanks very much!
Good idea!!! you can do that at the end of the battle there is a message that warns of the new learned skill ???

Original thread: https://forums.rpgmakerweb.com/threads/using-skill-learns-a-new-skill.84987/