Unlock greyed out skill with Stat

I'm currently trying to solve a problem that I thought I didn't need a script for, because it's actually one of the basics of what RPG Maker should be able to do.

I have 3 Actors, each of which has one special skill that should always be grayed out (not useable) unless a specific stat is applied to that Actor. In that case, the skill should become "unlocked" and useable as long as the state lasts.

It's always the same Stat that must be applied to unlock those Actor's special skills, like:
  • Actor A has Special Skill A that is greyed out and unusable -> Stat 1 is applied to Actor A -> Special Skill A becomes available for Stat duration
  • Actor B has Special Skill B that is greyed out and unusable -> Stat 1 is applied to Actor B -> Special Skill B becomes available for Stat duration
  • Actor C has Special Skill C that is greyed out and unusable -> Stat 1 is applied to Actor C -> Special Skill C becomes available for Stat duration
I thought that couldn't be that hard to achieve but seems impossible with what RPG Maker Vx Ace offers by default.

Can someone help me out with a quick snipped to do this?

Best Regards
Tw0Face
a skill needs two parts to be usable: the skill itself and the skill type.

so by default there are two different ways to handle this:
1) have the actor learn the skill and the state to add the skill type
2) have the actor add the skill type and the state to add the skill

In both cases the skill is invisible until usable however

if you want the skill to be greyed out by default, you would have to use the weapon requirement, or a script to change the behaviour.
If I remember correctly both yanfly and tsukihime have written script that can do this, but I don't have the links or names anymore. you'll have to look on their websites (himeworks.com and yanfly.moe)
FINAL EDIT​

Or try this piece of code.

Ruby:
# * KSkillNeedsState ACE * #
#   Scripter : Kyonides Arkanthes
#   2023-01-29

# * Free as in Beer * #

# Leave this note _need state ID_ in the Skill's Note box.
# There ID stands for any existing State ID.

module KSkillNeedsState
  SKILL_REGEX = /_need state (\d+)_/i
end

class Game_Battler
  alias :kyon_gm_btlr_skill_cond_met? :skill_conditions_met?
  def skill_need_state?(skill)
    return true if skill.note[KSkillNeedsState::SKILL_REGEX] == nil
    state?($1.to_i)
  end

  def skill_conditions_met?(skill)
    result = kyon_gm_btlr_skill_cond_met?(skill)
    result = skill_need_state?(skill) if result
    result
  end
end

Original thread: https://forums.rpgmakerweb.com/threads/unlock-greyed-out-skill-with-stat.154500/