Custom Critical Hit Effects Tips & Tricks (Resolved)

Hello ^^
New day, new question.
I'm trying to use a Yanfly Tips & Tricks in a more personalized way for my game.
This is Critical Hit Effects, which allows you to check if an attack has inflicted a critical hit to produce an additional effect.
Here is the formula:


Establish Effect>
// Check if the attack is a physical attack that dealt HP damage from a critical hit.
if (this.isPhysical() && target.result().hpDamage > 0 && target.result().critical) {
// Create an AGI buff that lasts 5 turns.
user.addBuff(param, turns);
var param = 6;
var turns = 5;
user.addBuff(param, turns);
}
}
</Custom Establish Effect>


I would like to modify this formula because the agility bonus is not interesting for me. In exchange, I would like the attacker who inflicted the critical hit to get a status.
This allowed me to more freely choose the bonuses I want to give to the characters.

Small additional question: do you think that the same formula exists but only to check if an attack inflicted damage successfully? (excluding missed attacks, regardless if it is a critical hit or not); This would save me from recreating a topic in 5min ^^"


(translation made by google, please ask me to rephrase if necessary)
I would like to modify this formula because the agility bonus is not interesting for me. In exchange, I would like the attacker who inflicted the critical hit to get a status.
So replace the line with user.addBuff with user.addState(x), with x being the ID of the state.
Small additional question: do you think that the same formula exists but only to check if an attack inflicted damage successfully? (excluding missed attacks, regardless if it is a critical hit or not);
Just read the code, it's already there. (I realize your English might not be good enough to recognize the words)
Code:
// Check if the attack is a physical attack that dealt HP damage from a critical hit.
if (this.isPhysical() && target.result().hpDamage > 0 && target.result().critical) {

It is telling you that it's checking if it's a physical attack that dealt HP damage, just remove the part that says critical.
Code:
if (this.isPhysical() && target.result().hpDamage > 0) {
Thank you very much for your answer.
Indeed, I am not very good in English ^^"
Everything works fine =)

Original thread: https://forums.rpgmakerweb.com/threads/custom-critical-hit-effects-tips-tricks-resolved.148238/