Enemy who mimics skills used on it

I want to create a boss fight where at its base, the boss will perform no action against the party, but will acquire any offensive or magic move used against it for the duration of the battle.

So for example. The first skill used on the boss is the basic normal attack. Since its been hit with it, now the boss will acquire the attack skill and be able to use it. Fire2 magic spell is used against it. Now the boss knows the basic attack skill and Fire 2. Silence skill is used but the boss is unaffected by it, but since the skill did actually hit, now the boss knows basic attack, fire2 and silence. And so on for there.

With this kind of set up the boss would not gain skills the target a party member, only those that target it. My thoughts on doing this so far is to create a common event with enemy appeared. Then have a variable set with each skills the party can learn that can be used against it with the count set to 1. Having a second event, calling the variable with a conditional branch of 1 being meet on the variable, I have a learn skill present with the move present in the variable which should allow the enemy to learn the skill. I have tried this, but I have had no luck at it actually working. Any ideas?
I thought of a way, but it'd be tedious. Make each skill you want a monster to be able to learn grant a hidden state. I believe if you leave the icon blank it doesn't show up. On the enemy tab, do a condition for when the state is applied, it's allowed to use said skill.

Make the state only release on death or at the end of battle and this will also cause it to reset, so every new mob would start over fresh.

They could be a better way, I don't know. This way would use up a lot of states.

edit: for the silence thing, just make the enemy immune to silence but the state from the skill should still hit.

this idea isn't play tested
This tactics seems to work. I realized that my initial idea also works as well, I just had to call the common event that keep track of the skill used on that actual skill itself. Both ways are time consuming by they do at least work. Thanks for the help Venka
Remember to make it targettable by a Healing spell, and making him "undead" (vulnerable to healing attacks). I want to see the monster being masochist xD.

===

Mostly this thing could be done with a script, but the states stuff seems fine. You can also use switches for the same result , and then deactivate all those switches after the battle, if it's going to be a boss. If it is a regular monster then it could be more troublesome (and all monsters would "learn" the new skill at the same time), but having a parallel process on maps where it appears could work.

Grogggg,

OZ
This battle is a boss battle. So id only have to do this once.

Original thread: https://forums.rpgmakerweb.com/threads/enemy-who-mimics-skills-used-on-it.18192/