How to call on party in scripts?

I'm making a tank character for my game and I'm using one of Yanfly's tips and tricks skills called Hexdrinker. The skills makes it so if the user's health falls below a certain point that user is given a shield. However I wanted to change this for my game so if her health fall below 30% her party are given shields instead. I don't understand scripting at all and I need help trying to figure this out. The community has been really helpful so far with answering my noobish questions and I would go on to say the rpg maker community is the most supportive community I've come across.

I apologize in advanced if this is in the wrong thread or if I'm breaking any forum rules. I don't post on the forums that often.

The script is below. Thanks in advanced

<Custom Regenerate Effect>
// Default the Hexdrinker's cooldown to 0.
user._hexdrinkerCooldown = user._hexdrinkerCooldown || 0;
// If the Hexdrinker's cooldown is greater than 0...
if (user._hexdrinkerCooldown > 0) {
// Then decrease its cooldown.
user._hexdrinkerCooldown -= 1;
}
</Custom Regenerate Effect>

<Custom Respond Effect>
// Default the Hexdrinker's cooldown to 0.
target._hexdrinkerCooldown = target._hexdrinkerCooldown || 0;
// Check if the action dealt magical HP damage and if the target's current HP rate is under 30%. Also check if there is no cooldown on the Hexdrinker.
if (this.isMagical() && target.result().hpDamage > 0 && target.hpRate() <= 0.30 && target.hp >= 0 && target._hexdrinkerCooldown <= 0) {
// The amount of points for the absorption barrier.
var barrier = 250;
// How many turns the barrier will last.
var turns = 3;
// Make the target gain barrier points for those turns.
target.gainBarrier(barrier, turns);
// Set the cooldown for the Hexdrinker.
target._hexdrinkerCooldown = 5;
// Play an animation on the target.
target.startAnimation(53);
}
</Custom Respond Effect>
In the skill you made make sure the target is all allies, and it will target all allies.

Also you may nee ti change the user in the code to origin.
Try changing the targeting and then if there's still problems change user to origin.
In the skill you made make sure the target is all allies, and it will target all allies.

Also you may nee ti change the user in the code to origin.
Try changing the targeting and then if there's still problems change user to origin.
That won't do because If I change the target to all allies then everyone will get the passive state. I only want the shields to be applied the the user of the skill health is below 30%

Where it says targetgainbarrier how do I change that so the party gains barrier instead
That won't do because If I change the target to all allies then everyone will get the passive state. I only want the shields to be applied the the user of the skill health is below 30%

Where it says targetgainbarrier how do I change that so the party gains barrier instead
The target is who ever the skill/state was inflicted on, thus if your skill had the ability to target it would inflict everyone in the party.

How ever if you want to mess with the code:

<Custom Respond Effect>
// Default the Hexdrinker's cooldown to 0.
origin._hexdrinkerCooldown = origin._hexdrinkerCooldown || 0;
// Check if the action dealt magical HP damage and if the target's current HP rate is under 30%. Also check if there is no cooldown on the Hexdrinker.
if (this.isMagical() && origin .result().hpDamage > 0 && origin.hpRate() <= 0.30 && origin.hp >= 0 && origin._hexdrinkerCooldown <= 0) {
// The amount of points for the absorption barrier.
var barrier = 250;
// How many turns the barrier will last.
var turns = 3;
// Make the target gain barrier points for those turns.
for (i=0; i < $gameParty.size(); i++){
$gameParty.member().gainBarrier(barrier, turns);
// Play an animation on the target.
$gameParty.member().startAnimation(53);
}
// Set the cooldown for the Hexdrinker.
origin._hexdrinkerCooldown = 5;
}
</Custom Respond Effect>

The only problem with the coding above is if everything works properly, the cooldown maybe messed up as it comes after the animation.
The target is who ever the skill/state was inflicted on, thus if your skill had the ability to target it would inflict everyone in the party.

How ever if you want to mess with the code:

<Custom Respond Effect>
// Default the Hexdrinker's cooldown to 0.
origin._hexdrinkerCooldown = origin._hexdrinkerCooldown || 0;
// Check if the action dealt magical HP damage and if the target's current HP rate is under 30%. Also check if there is no cooldown on the Hexdrinker.
if (this.isMagical() && origin .result().hpDamage > 0 && origin.hpRate() <= 0.30 && origin.hp >= 0 && origin._hexdrinkerCooldown <= 0) {
// The amount of points for the absorption barrier.
var barrier = 250;
// How many turns the barrier will last.
var turns = 3;
// Make the target gain barrier points for those turns.
for (i=0; i < $gameParty.size(); i++){
$gameParty.member().gainBarrier(barrier, turns);
// Play an animation on the target.
$gameParty.member().startAnimation(53);
}
// Set the cooldown for the Hexdrinker.
origin._hexdrinkerCooldown = 5;
}
</Custom Respond Effect>

The only problem with the coding above is if everything works properly, the cooldown maybe messed up as it comes after the animation.
That target thing makes sense, I tried to change the scope but realized it was a passive ability so it doesn't have a scope. You just place a notetag in where ever you want to call it from then I copied your notetag and replaced the respond section but it's still giving me an syntax error

I appreciate you helping me this long though, it's a lot more than what most people are willing to do. I may just scrap it from my game all together. Coding is hard
Try this:
<Custom Regenerate Effect>
// Default the Hexdrinker's cooldown to 0.
origin._hexdrinkerCooldown = origin._hexdrinkerCooldown || 0;
// If the Hexdrinker's cooldown is greater than 0...
if (origin._hexdrinkerCooldown > 0) {
// Then decrease its cooldown.
origin._hexdrinkerCooldown -= 1;
}
</Custom Regenerate Effect>
<Custom Respond Effect>
// Default the Hexdrinker's cooldown to 0.
origin._hexdrinkerCooldown = origin._hexdrinkerCooldown || 0;
// Check if the action dealt magical HP damage and if the target's current HP rate is under 30%. Also check if there is no cooldown on the Hexdrinker.
if (this.isMagical() && origin .result().hpDamage > 0 && origin.hpRate() <= 0.30 && origin.hp >= 0 && origin._hexdrinkerCooldown <= 0) {
// The amount of points for the absorption barrier.
var barrier = 250;
// How many turns the barrier will last.
var turns = 3;
// Make the target gain barrier points for those turns.
for (i=0; i < $gameParty.size(); i++){
$gameParty.members().gainBarrier(barrier, turns);
// Play an animation on the target.
$gameParty.members().startAnimation(53);
}
// Set the cooldown for the Hexdrinker.
origin._hexdrinkerCooldown = 5;
}
</Custom Respond Effect>


If it still doesn't work then go back to the original coding, make the state a regular state, and make a skill that will apply it to everyone and just use YEP_InstantCast to make it an instant skill, so the user if the skill can cast it and then do another skill after that.
You can if you want make it where it's only usable if the person who has the skill, has less than 30% their maxhp.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-call-on-party-in-scripts.78057/