How can I implement follow-up or link attack skills?

alright this is primarily me brainstorming in a public space lmao
so I want to implement a skill where an actor attacks, and either at the end of round or (for a different skill) if the other party members attack it does more instances of damage. think Link or Follow-up skills from Etrian games.

for reference, those tend to work like this-
actor 1 attacks with a link skill. if the enemy gets hit with a physical attack during that round, there is a chance for the enemy to get hit with a followup attack afterwards. these follow-up attacks can trigger off of multi-hit attacks by other party members, but they can't proc themselves and there's a max limit of how many attacks can be triggered per round. (also after you proc a follow-up attack in that round it reduces the chances of other follow-ups, but there's buffs to increase max follow-ups and proc chance)

I have the Yanfly stuff, so my current thoughts on how to implement this goes like this:
needed plugins: yanfly action sequences and skills/states core

first, i want to do a skill where the character attacks and it's immediately followed up by an elemental attack of equivalent power. the first attack uses the element of the weapon, and the follow up has a specific element to it. also it enchants the weapon to said element but that's a fairly simple applied state. (i think this one can be done by simply having it repeat twice and applying the enchant element state after the attack completes.)

second, I want to make a skill where it attacks at the beginning of the turn and again after the target gets hit by a certain kind of attack (physical or magical that deals hp damage), basically like the link skills above. this one i think would require applying a state to target that plays an animation using action states and deals damage if the target is hit by an hp-reducing physical or magic attack.

anyway i basically just need to figure out how to build that followup state. if I could get some help configuring that it'd be great!
first, i want to do a skill where the character attacks and it's immediately followed up by an elemental attack of equivalent power. the first attack uses the element of the weapon, and the follow up has a specific element to it. also it enchants the weapon to said element but that's a fairly simple applied state.
As far as I know, the trick to this is that the element is tied to the current skill being used. So what you would have to do is use a Skill Core After Eval that does a force action script call on your second attack that has the fire element defined (and then that has an After Eval that puts a state on the actor).

second, I want to make a skill where it attacks at the beginning of the turn and again after the target gets hit by a certain kind of attack (physical or magical that deals hp damage), basically like the link skills above. this one i think would require applying a state to target that plays an animation using action states and deals damage if the target is hit by an hp-reducing physical or magic attack.
I presume by "action states" you mean "action sequences" which wouldn't be necessary to implement this. You'd have your skill attack for damage and also apply a state.

Inside that state, you put a Custom Respond Effect from Buffs & States Core that checks for a damaging attack, inflicts more damage, then removes itself.

Code:
<Custom Respond Effect>
if (this.isDamage())
{
    target.gainHp(-20);
    target.startDamagePopup();
    if (target.isDead())
       target.performCollapse();
    target.removeState(state_id);
}
</Custom Respond Effect>
where 20 is however much damage you want it to do, and state_id is the ID of that state.
thanks a ton!
its also pretty easy to just do a normal attack attached to a different skill, so thatll be nice for other multi-hit skills. thanks for your help!

oh off the top of your head do you know how to specify the damage type of the follow-up damage?

Original thread: https://forums.rpgmakerweb.com/threads/how-can-i-implement-follow-up-or-link-attack-skills.153353/