Substitute skill pkmn style

I don't even know where to begin here, I would like to have a skill that summons an actor that has a few skills that mimic the player, but more importantly if the summoning player were to take any targeted damage, the summon would "cover" or absorb the attacks.
I have SRD_SummonCore, so creating the summon works fine, the only idea I can do is giving the summon taunt which does not solve the issue, since taunt would only allow it to be focused, I want other party members to be able to hit, only the caster is protected from all by "all" or "aoe" attacks.
for the absorb part, you might want to lok into YEP_Buff&StateCore and use
a lunatic code to give the actor (that summon the actor) a state.
if he get attacked with the state active, the summoning would absorb the dmg,
if the summon actor dies or dissapear, so does the state.

as for the lunatic code needed, I have not much knowledge to create that one for you.
but there are ppl that are able to help you with that if need.
for the absorb part, you might want to lok into YEP_Buff&StateCore and use
a lunatic code to give the actor (that summon the actor) a state.
if he get attacked with the state active, the summoning would absorb the dmg,
if the summon actor dies or dissapear, so does the state.

as for the lunatic code needed, I have not much knowledge to create that one for you.
but there are ppl that are able to help you with that if need.

Yeah im not sure how to do this, I always liked the skill in pokemon. I had an idea using Yanfly taunt and Single Target Provoke, but like usual I cant make heads or tails of anything he codes.
I did try this and maybe someone can help.

Summon skill, add state to user
<Before Eval>
user.addState(47);
</Before Eval>


State 47 (invisible just to prevent targeting)

<Custom Action Start Effect>
var action = user.currentAction();
if (action && action.isForOpponent() && b.isStateAffected(47)) {
action.setTarget.actor(13);
}
/Custom Action Start Effect>

<Custom Remove Effect>
if (!== $gameParty.members().contains($gameActors.actor(13))){
user.removeState(47);
}
}</Custom Remove Effect>

Sadly none of this is working in the slightest.

Idea being if the enemy is using an action and the target has the invisible state then the action will target actor(13) being the summon. Does not work, cant figure it out.

Second I dont know the codes of any of this but tried to have custom remove of state if actor(13) is not in party, user remove state.
I made some progress, so of.

I can create a state(47) that changes target rate to 0%, apply it to user when spell is cast aka summon. This ensure that only "all" attacks will hit the target. The problem is that I don't know how to dispel the state upon the summons death.

I had an idea but it also doesnt work, maybe I dont have the right code to use, but I want to add a notebox in the summon spell that grants the summon a state, since states are removed on death, it should in theory trigger custom remove effect of my other actor.

Skill notebox:
<Before Eval>
user.addState(47); // adds the untargetable state to the caster.
</Before Eval>

<After Eval>
actor(2).addState(48); // adds a dummy state to summon.
</After Eval>


State 48 notebox:
<Custom remove Effect>
actor(2).removeState(47); // this removes the summoner target rate of 0% state.
</Custom remove Effect>

This does not work because actor(id) doesnt seem to work with add and remove states. Did I do something wrong?
Also side note, SRD summoncore conflicts with my project so ill have to scrap it lol.

Original thread: https://forums.rpgmakerweb.com/threads/substitute-skill-pkmn-style.120487/