Forget a random skill [RMVX ACE] [Solved]

Good day ladies and gentlemen.

I am looking for a way to forget a random skill that an actor knows.
Like you get amnesia and you start forgetting things...
But using a variable and make it do a random 1-999 or in my case 1-3000 has a BIG chance to not forget any skills that a actor learned.
However. Some skills I do not want to be forgotten. So we need a bit of control here.
I know I could do this with common event branch but I am not sure if I can get it to work accurately.
Let me just mention that I have over 219 spell and 153 special skill that a single actor could learn.

How can we do this?
Easy. Put this as a new script.
Code:
class RPG::Skill
  def unforgetable
    note.include?("<unforgettable>")
  end
end

class Game_Actor
  def forget_random_skill
    s_id = @skills.select {|id| !$data_skills[id].unforgetable}.shuffle.shift
    forget_skill(s_id) if s_id
  end
end
Tag your skill you don't want them to get forgotten with <unforgettable>.
To make an actor forget a random skill, use script call $game_actors[actor_id].forget_random_skill
Replace actor_id with your actor id.

Disclaimer: Not tested.
Thank you for your fast replay Theoallen.
So far it works great and everything functions.
I love it when I hear someone say... "Easy"
And we none-scripters sit here going branch by breach for each skill...
And you just make it work with 12 lines. 😅
Thank you very much.
Disclaimer: tested

Original thread: https://forums.rpgmakerweb.com/threads/forget-a-random-skill-rmvx-ace-solved.122782/