Applying states and other properties for skills/traits

I have a bit of an issue coding several types of skills which will be outlined below.

1. A skill which gives a state that functions similarly to a "time bomb" that occurs when a certain condition is fulfilled or timer runs out.
Excogitation.png
2. A "trait", as I'd like to call it, that has a skill invoke another skill to give a state that enhances yet another skill.
Freecure.png
3. A skill that deals multiple hits but the subsequent hits do less damage.
Deadly Icicle.jpg

Any ideas on how to code these? If any plugins are required, what should I use?
I am not sure if any of those are covered, but Yanfly has a Tips & Tricks section that tells how to set up a lot of popular skills. If he doesn't have one on the skills above, you may learn how by watching some of the other vids.
the 1st 2 can be done with
http://yanfly.moe/2015/12/25/yep-50-buffs-states-core/ using the note tags
<Custom Respond Effect>
code
</Custom Respond Effect>
and
<Custom Establish Effect>
code
</Custom Establish Effect>
as for how u write the code part dont ask me, im horrible at that stuff

and the 3rd can be done with action sequences from another yanfly plugin
action sequences can get realy big but add all kinds of control as to how ur skill function
anywhere from how it looks to things like "hit, add state, hit again, add state, hit again, remove all 3 states"
Tiamat-86 said:
the 1st 2 can be done with
http://yanfly.moe/2015/12/25/yep-50-buffs-states-core/ using the note tags
<Custom Respond Effect>
code
</Custom Respond Effect>
and
<Custom Establish Effect>
code
</Custom Establish Effect>
as for how u write the code part dont ask me, im horrible at that stuff

Where may I find all the code functions for these anyway? I don't know exactly what works and am wondering if there's a pileup of ones that do work.

EDIT: The Custom Respond effect works, but is happening too early (like at 100% HP and not 50%).
Skill 1:
Plugins Needed:
-Yanfly's buff states core
-Yanfly Select Control(it requires Tatget Core and Battle Engine Core)

Skill:
-Apply on 1 Ally
-Add State 1000%
-Notetags:
<Select Conditions>
Not User
</Select Conditions>

State:
-Have it last x amount of turns.
-Notetags:
<Custom Turn End Effect>
if(user.hp < 0.5 * user.mhp){
var restore = x;
user.gainHp(restore);
user.removeState(y);
}
</Custom Turn End Effect>
<Custom Leave Effect>
var restore = x;
user.gainHp(restore);
</Custom Leave Effect>
Where y is the state id of this state. And x is the amount you want to heal.
Make x = user.mhp, if you want a full heal.

Skill 2:
Plugins Needed:
-Yanfly Skill Core
Cure:
-Notetag:
<After Eval>
var roll = Math.randomInt(100)+1;
if(roll < 15){
user.addState(X);
}
</After Eval>

Cura:
-Notetag:
<Custom MP Cost>
if(user.isStateAffected(x)){
cost = 0;
}else {
cost = y;
}
</Custom MP Cost>

Where is the state id of the state that's going to be applied. And y is the amount if hp the skill cost if normal.

Skill 3:
Plugins:
Skill Core, you should already have from skill 2.

-Skill:
-Notetags:
<Pre-Damage Eval>
user._Casted = user._Casted || 0;
value -= (x * user._Casted * value);
</Pre-Damage Eval>

<Post-Damage Eval>
user._Casted += 1
</Post-Damage Eval>
<Post-Damage Eval>
if(user._Casted >= y){
user._Casted = 0
}
</Post-Damage Eval>


Where x is the amount of damage you want your skill to do less of. (Example do 25% less damage do "value * 0.25" in place of "x"). And where y is the number of times the skill hits.(ie if it suppose to hit 3 times, make y, 3).

For the multiple hits change the skill repeat
to a number greater than 1. If you don't know where that is. It is under Invocation, and set Repeat to a number greater than 1. If it's 2 the skill hits twice, 3 hits thrice and so on.
Zarsla said:
Skill 1:
Plugins Needed:
-Yanfly's buff states core
-Yanfly Select Control(it requires Tatget Core and Battle Engine Core)

Skill:
-Apply on 1 Ally
-Add State 1000%
-Notetags:
<Select Conditions>
Not User
</Select Conditions>

State:
-Have it last x amount of turns.
-Notetags:
<Custom Turn End Effect>
if(user.hp < 0.5 * user.mhp){
var restore = x;
user.gainHp(restore);
user.removeState(y);
}
</Custom Turn End Effect>
<Custom Leave Effect>
var restore = x;
user.gainHp(restore);
</Custom Leave Effect>
Where y is the state id of this state. And x is the amount you want to heal.
Make x = user.mhp, if you want a full heal..

You have just won the day with this one! I can copy this for a Turn Start effect too.

Zarsla said:
Skill 2:
Plugins Needed:
-Yanfly Skill Core
Cure:
-Notetag:
<After Eval>
var roll = Math.randomInt(100)+1;
if(roll < 15){
user.addState(X);
}
</After Eval>

Cura:
-Notetag:
<Custom MP Cost>
if(user.isStateAffected(x)){
cost = 0;
} else {
cost = y;
}
</Custom MP Cost>

Where x is the state id of the state that's going to be applied. And y is the amount if hp the skill cost if normal.

Interesting take on the skill; I used
<Post-Damage Eval>
if (user === $gameActors.actor(4))
var Cure = 0.15
if ($gameActors.actor(4).skills().contains($dataSkills[72]));
if (Math.random() < Cure)
user.addState(20)
</Post-Damage Eval>
to make it read that the actor has a certain skill before triggering and
<Custom Execution>
if (a.isStateAffected(20))
user.gainMp(Math.floor(a.mmp * 0.03))
a.removeState(40)
</Custom Execution>
to refund the MP cost since I use %'s. I think yours looks easier on the eye for the MP cost though.

Zarsla said:
Skill 3:
Plugins:
Skill Core, you should already have from skill 2.

-Skill:
-Notetags:
<Pre-Damage Eval>
user._Casted = user._Casted || 0;
value -= (x * user._Casted * value);
</Pre-Damage Eval>

<Post-Damage Eval>
user._Casted += 1
</Post-Damage Eval>
<Post-Damage Eval>
if(user._Casted >= y){
user._Casted = 0
}
</Post-Damage Eval>


Where x is the amount of damage you want your skill to do less of. (Example do 25% less damage do "value * 0.25" in place of "x"). And where y is the number of times the skill hits.(ie if it suppose to hit 3 times, make y, 3).

@Tiamat thankfully helped with this one with the action sequence idea; props to him on that!
I would have done your code like this, as to why it's easier to read and not using brackets can lead down a rabbit whole of errors. Everything else is just shorten code:
<Post-Damage Eval>
if (user.actorId() === 4){
var Cure = 0.15;
if(user.skills().contains($dataSkills[72])){
if (Math.random() < Cure){
user.addState(20)
}
}
</Post-Damage Eval>
<Custom Execution>
if (a.isStateAffected(20)){
var calc = Math.floor(a.mmp * 0.03):
user.gainMp(calc);
user.removeState(40);
}
</Custom Execution>
Huh, I usually tend to get random "unexpected identifier" errors when I try it like that; also your post alerted me to the error of non-identical state numbers.

Original thread: https://forums.rpgmakerweb.com/threads/applying-states-and-other-properties-for-skills-traits.95358/