MV Yanfly Counter Control using action sequence input

After asking around, I have decided to change how my Expedition 33-esque enemy parrying will work. I have been informed that Yanfly’s Counter Control can get me results I wanted. I just need a few things:

- Getting a counter to work: I have been trying to activate a counter via switches, I tried both if a switch remains active during the duration of the enemy attack, AND when a switch turns on at the end. I haven’t gottem one to activate for neither.

-I need to make sure that a party-wide counter can work, where the whole party gets targetted, and they can counter Individually.

Any advice on either of these will be very helpful, thanks!
I have a couple of suggestions for you.

1 - Have one thread. You've now made three different threads about different parts of this system and that can only make life harder for you and the people who are willing to help you. Instead of splitting every tiny bit of this parry/counter system into individual threads, have one place where you're saying "I need help making this system." Then you can deal with each aspect as it comes up and everyone reading the thread knows what has already been said.

2 - Actually describe in proper detail what you're trying to do. You have not done this in any of those three threads (and the first was the worst, where you actually say contradictory things in the various posts and title). If you want other people to understand what you want in order to give you technical help, you need to accurately explain - using gameplay examples - exactly what you want to happen.

- Getting a counter to work: I have been trying to activate a counter via switches, I tried both if a switch remains active during the duration of the enemy attack, AND when a switch turns on at the end. I haven’t gottem one to activate for neither.
As far as you've described, none of this should be necessary. You also don't show how you've done any of it, so no one can tell you if it's right or wrong.

-I need to make sure that a party-wide counter can work, where the whole party gets targetted, and they can counter Individually.
Again, as far as you've described, this should make no difference. If an actor is hit by something and it meets the conditions of their counter skill, they should counter. The targeting is irrelevant.

You need to actually show people what you've done, how your skill is set up, how you're doing your action sequences, how you've set up your counter skills. Otherwise, any answers you get are just guessing at different parts.
okay, sorry for causing an inconvenience, and sorry for taking so long to respond.

First thing: I originally had this code for enemy attacks and player counters
Code:
CHANGE SWITCH 25: on
CHANGE SWITCH 30: off
CHANGE VARIABLE 11 = 1
CHANGE VARIABLE 14 = 0

START SEQUENCE INPUT: ok, 6

END SEQUENCE INPUT

if (target.isAffected(10))
 action effect
 collapse: target
 CHANGE SWITCH 25: off
else
 if (Input.isPressed('shift'))
  SE: Blow1
  motion guard: target
  wait: 10
  CHANGE VARIABLE 11 = 2
  action effect
  collapse: target
  CHANGE VARIABLE 11 = 1
  wait: 5
  CHANGE SWITCH 25: off
 else if $gameVariables.value(6) < 5
  action effect
  collapse: target
  wait: 5
  CHANGE SWITCH 25: off
 else
  SE: Sword2
  motion guard: target
  wait: 5
 end
end
death break

if $gameSwitches.value(25) == true
 CHANGE VARIABLE 14 = 1
 FLASH SCREEN: 0, 255, 255, 50, 5
 MP +20%: target, show
 SE: Attack1
 wait: 5
 motion attack: target
 wait 5
 animation 2: user
 wait for animation
 action effect: user
end

Switch 25 checks if the attack is counterable, and Variable 14 is to change the damage formula. Since all of this is happening during the enemy's turn, I wanted to make sure that the enemy wasn't calcing against itself.

so i made this damage formula:
v[14] > 0 ? b.atk * 4 - a.def : (a.atk * 3 - b.def * 2) / v[11]

The problem I was facing was that I noticed upon testing that the formula wasn't changing. Every counter attack was doing too little damage. I also faced a little deal that I was worried about the attack elements not being the countering actor's.

I asked on Reddit for a solution, and found the recommendation to try Yanfly's Counter Control, and set counter conditions to a switch.

With that idea, I changed the counter sequence just to this:
Code:
if $gameSwitches.value(25) == true
 CHANGE SWITCH 30: on
end

And I set the counter conditions to the respected skill and set those skills to the weapons.

Switch 30 being the switch which is meant

Of course, the problem I'm dealing with is that the counter attack just isn't triggering, which leaves us caught up to now.

Main issue: I need help with a counter attack that will actually use the party member's stats.
You need to actually show people...how you've set up your counter skills.
You still haven't done this, which means we have no way to tell you whether they've been set up properly.

However, there are some issues with what you posted.

First, there's no such thing as target.isAffected(10) so that conditional can never be true and the commands inside will never happen. I assume you intended to check for a state, which is isStateAffected()

I also don't understand what you're going for logically - what's the purpose of checking for them to be pressing Shift when they were supposed to be doing a timed input using Enter?

Second, unless you're using an additional plugin found here, you can't nest if statements. That means a whole chunk of your action sequence is simply nonfunctional by default (when you have the else and then another if/else if/etc. inside of it).

With that idea, I changed the counter sequence just to this:
Code:
if $gameSwitches.value(25) == true
 CHANGE SWITCH 30: on
end
What's the point of that? Why would you need to make a second switch that's simply the same value as the first switch instead of just checking the first switch?
Okay, I realized the issue:

Since this is all happening during the enemy's turn, I have the action effect be set to the user. This likely overrides the initial target, and turns "b.atk" into the user. I found out I can bypass this and instead use a variable in place of b.atk.

Here is a change I currently have so far:
Code:
eval: $gameVariables.setValue(17, this._targetIndex);
eval: $gameVariables.setValue(18, $gameActors.actor($gameVariables.value(17)).atk);

variable 17 finds the target indexof the actor, and Variable 18 grabs the attack stat of the target index.

I'm still having problems getting the whole thing to work. If there is one thing I need to change here, Anything would be appreciated.
Okay, okay, I got it working.

I just had to include this:

Code:
CHANGE VARIABLE 18: target.atk

Sorry for the inconvenience.

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-counter-control-using-action-sequence-input.181538/