Replace skills based on equipped weapon

I want to make a script that changes a character's skill based on the type of weapon he is holding.

For example:

If the character is equipped with weapon type 1, he will have Skill A.

If not, skill A will be replaced with Skill B.

Sadly, I have no idea how to script this. Any ideas?
You can simply attach the skill(s) to the weapon in the database editor

and you can also set the weapon to "seal" the other skills that you don't want the actor to use when he/she is holding the weapon.

edit:

Actually posted in a similar topic a few minutes ago right here in the request board.

You can have more control over this with equip slots changing too.

http://forums.rpgmakerweb.com/index.php?/topic/50873-auto-equip-slots-beginner-friendly/
You can simply attach the skill(s) to the weapon in the database editor

and you can also set the weapon to "seal" the other skills that you don't want the actor to use when he/she is holding the weapon.

edit:

Actually posted in a similar topic a few minutes ago right here in the request board.

You can have more control over this with equip slots changing too.

http://forums.rpgmakerweb.com/index.php?/topic/50873-auto-equip-slots-beginner-friendly/
That's nice and all, but Skill B still exists. I want Skill B to overwrite Skill A when weapon type 1 is equipped.
You can seal skill B with weapon 1, so the player will no longer be able to use skill B when he/she is has weapon 1 equipped.

If that isn't enough, you can then use a script to hide unavailable skills so that it won't show up in the menu/battle. Check the master script list for the hide skill script. If i remember right it's one of Yanfly's.
You can seal skill B with weapon 1, so the player will no longer be able to use skill B when he/she is has weapon 1 equipped.

If that isn't enough, you can then use a script to hide unavailable skills so that it won't show up in the menu/battle. Check the master script list for the hide skill script. If i remember right it's one of Yanfly's.
Ah, good old Yanfly... Programmer of the gods!

And thanks for the suggestion.
You're welcome!

Original thread: https://forums.rpgmakerweb.com/threads/replace-skills-based-on-equipped-weapon.52855/