Using Notetag to Activate Switch or Conditional Branch

Hello!
So I have a battle that allows player to evade manually, using SRDude plugin called Active Defense Charge.
It's done by modifying the "Attack" skill notetag.

I want to automatically activate a counterattack whenever the player successfully evade.
To achieve that effect, I think that requires some kind of switch activation or conditional branch from notetag.
Is it possible to activate switch or conditional branch via notetag?

For more information, I also use Yanfly Action Sequence and Counter Control.
<notetag: dgutdf>
What is notetag? It's something in this shape. MV by default parses notetags and then whatever is in front of the : is considered the metatag name and whatever is on the right is passed to it as a string (including spaces and stuff, which is why you often need to maintain proper spacing). Btw. If we input this notetag to actor 1's note field, this is how we would work with it if we cared about the exact value:
Code:
if ($gameActors.actor(1).meta["notetag"] ==" dgutdf") {
//code}
So it's impossible to trigger a conditional branch only via a notetag. You would probably need to edit the SRD's evasion plugin (in particular when the player successfully evaded) to contain this code after that: determine the notetag's existence and trigger Yanfly counterattack function.
<Target Action>
enemy sequence attack go here
if (!target.result().isHit())
actor counter attack go here
end
</Target Action>
Thanks!
Anyway, here's the code I put in attack notetag:

<setup action>
display action
immortal: targets, true
</setup action>

<target action>
if user.attackMotion() !== 'missile'
move user: targets, front, 20
else
perform start
end
wait for movement
motion attack: user
wait: 10
attack animation: target
wait for animation
action effect
<Active Defense: charge>
<End Active Defense>
if (!target.result().isHit())
<Timed Attack: clock>
Target 1: 45, 180, rgba(200, 170, 0, 1), 1
Target 2: 200, 270, rgba(220, 150, 0, 1), 2
Target 3: 290, 330, rgba(240, 130, 0, 1), 3
<End Timed Attack>

</target action>

The timed attack is the counterattack.
But it activated straight away after I select attack command, not after I can evade enemy attack.

Do I have to add this code first?
if ($gameActors.actor(1).meta["notetag"] ==" dgutdf") {
//code}
Code:
<setup action>
display action
immortal: targets, true
</setup action>

<target action>
if user.attackMotion() !== 'missile'
move user: targets, front, 20
else
perform start
end
wait for movement
motion attack: user
wait: 10
attack animation: target
wait for animation
action effect: target
<Active Defense: charge>
<End Active Defense>
if (!target.result().isHit())
motion attack: target
wait: 10
attack animation: user
wait for animation
action effect: user
end
</target action>

You cannot active time attack here
@Isabella Ava
Thanks!
I tried the code, but apparently the actor/enemy will counterattack no matter it's a hit or miss.
Also, the counterattack damage is 0. Perhaps I am missing something?
Code:
<setup action>
display action
immortal: targets, true
</setup action>

<target action>
if user.attackMotion() !== 'missile'
move user: targets, front, 20
else
perform start
end
wait for movement
motion attack: user
wait: 10
attack animation: target
wait for animation
action effect: target
<Active Defense: charge>
<End Active Defense>
if target.result().isHit() == false
motion attack: target
wait: 10
attack animation: user
wait for animation
action effect: user
end
</target action>
maybe this will work? 🙂 i am not on my computer so i can't test the skill @EpicFILE
Thanks!
I'm messing around and found a code that truly make it work.
But the no damage problem is still there.

<setup action>
display action
immortal: targets, true
</setup action>

<target action>
if user.attackMotion() !== 'missile'
move user: targets, front, 20
else
perform start
end
wait for movement
motion attack: user
wait: 10
attack animation: target
wait for animation
action effect: target
<Active Defense: charge>
<End Active Defense>
if $ActiveDefense.power <= 0
wait: 10
else
motion attack: target
wait: 10
attack animation: user
wait for animation
action effect: user
end
</target action>

The bolded part is the one that checks whether the player successfully dodge or not.
With that code, I successfully make the actor counter only when they dodged enemy attack.
But that's the problem, there's no damage on the counterattack.

Is there a way to call another skill instead if the actor successfully dodge? (like calling common event)
Something like this:

if $ActiveDefense.power <= 0
wait: 10
else
call counterattack skill
I want to do this as well, I'm trying to find a way.

I think it's just the damage formula to change :dizzy:

Original thread: https://forums.rpgmakerweb.com/threads/using-notetag-to-activate-switch-or-conditional-branch.90191/