Equip Skills AND Learn/Replace Skills

So, to keep it short:

My current project's vision is that instead of Attack/Defend in battles, you get the Actions command. The Actions command is a skill list (skill type: Actions) that has it's own skills, including the default Attack and Defend skills. All of those skills are equipable and interchangable, with not enough room for all the Actions you learn. Thus, choosing which 8 Actions to bring to battles is crucial.

The other half of this battle system is standard Skills. For this, however, it's more akin to SMT/Persona, as in, you may only have 8 Skills learned, and if you learn another skill, one must be permenantly removed to make room for the new Skill. I'd get into the details of the differences between the two skill types, but I'm keeping this short.

I've gotten a plugin (Yanfly) for the Actions system, but no matter where I've looked, there is no simple plugin for SMT/Persona-esque skill learning. I'd like to know how you would tackle this conundrum. This would be my take:

-Have a variable holding the ammount of learned skills of the Skills type for each actor
-When a skill is learned, a common event plays to check the variable
-If the variable is 8 or more, the common event asks to remove a skill to make room for the new skill

I don't see any way to implement this with pure database and events, as I don't see a way to check the number of skills of a type in an actor, nor do I see a way to check when a skill is learned to call the common event. How would I implement the second half of this skill system?

btw clarify if you need justification for this kind of system
You could use the js code "$gameActors.actor(x).skills().length" to find the number of skills you have however this is for all you're skill types. Ie if you have magic & special skill type all skills would be counted. However if a skill is set to none, it is not counted.
What you could do is set all your skills in Actions Command to have the skill type of none, and set it up so they are set to none and then make the Standard skills the only skill type and then use the code to check the amount of skills you have.

In terms of having a common event check the number of skills you have, will vary on how you learn skills. If you use anything other than the default method of learning skills through level uping you're either going to edit code or create work arounds. If you are using level upping to gain skills may I recommend this plugin by Himeworks.

Original thread: https://forums.rpgmakerweb.com/threads/equip-skills-and-learn-replace-skills.85646/