Skill Limitation

In my game I want the characters to be limited by 4 skill slots, and when learning a new skill
from leveling up they are prompted to replace one of the four or forget learning the new skill. (Like in Pokemon)

Is there a script that does exactly this? Or even limits the character's skill slots?
I'll take either since I can't find one script that can do this.

And if there is no script is it possible to do this somehow without one?

Original thread: https://forums.rpgmakerweb.com/threads/skill-limitation.136405/