Thornmail in Chrono engine

Hello. In Rpg Maker MV, Yanfly have a configuration with two of his plugins to make something similar to the thornmail item in League of Legends. An armor that deals a small percentage of the damage taken back to the enemy (an also this damage scales with your defense). But it seems the code doesn´t work with a system such as Chrono engine.

More information about the configuration here: http://www.yanfly.moe/wiki/Thornmail_(MV_Plugin_Tips_&_Tricks)

Someone know how could this be adapted to Chrono engine?
Both Yanfly Auto Passive States and Buffs and States core work with ChronoEngine. I believe you just need to change the object references in that code. I can look at it later but I'm away from my PC right now.
Both Yanfly Auto Passive States and Buffs and States core work with ChronoEngine. I believe you just need to change the object references in that code. I can look at it later but I'm away from my PC right now.
I know, and i have some passives made like that, probably something needs to change, as you say.
If you want this to work for when the enemy touches the player too it's going to require overwriting the touch damage function in ChronoEngine, the same way I did in that counter plugin I wrote.

If you want this to work for when the enemy touches the player too it's going to require overwriting the touch damage function in ChronoEngine, the same way I did in that counter plugin I wrote.
Is not when an enemy touch you, is when you take physical damage, even from a projectile.
I got it working. You'll need to put this in a new plugin file because damage in ChronoEngine runs through a new function outside of the core engine files.
Code:
//Yanfly Buffs States Core ChronoEngine Fix
Yanfly.BSC.Game_Action_executeDamage = Game_Action.prototype.executeDamageCN;
Game_Action.prototype.executeDamageCN = function(target, value) {
    value = this.onPreDamageStateEffects(target, value);
    value = this.onReactStateEffects(target, value);
    Yanfly.BSC.Game_Action_executeDamage.call(this, target, value);
    value = this.onRespondStateEffects(target, value);
    value = this.onPostDamageStateEffects(target, value);
};
I got it working. You'll need to put this in a new plugin file because damage in ChronoEngine runs through a new function outside of the core engine files.
Code:
//Yanfly Buffs States Core ChronoEngine Fix
Yanfly.BSC.Game_Action_executeDamage = Game_Action.prototype.executeDamageCN;
Game_Action.prototype.executeDamageCN = function(target, value) {
    value = this.onPreDamageStateEffects(target, value);
    value = this.onReactStateEffects(target, value);
    Yanfly.BSC.Game_Action_executeDamage.call(this, target, value);
    value = this.onRespondStateEffects(target, value);
    value = this.onPostDamageStateEffects(target, value);
};
Wow, thank you so much. You really are really talented.
I just know how to read code, and a lot of times I'm just copying and pasting the right section of code with a couple lines changed.

It is not as difficult as you think.
I just know how to read code, and a lot of times I'm just copying and pasting the right section of code with a couple lines changed.

It is not as difficult as you think.
I see. If i would want add more things like this, i should go to see some specific part of the code then. Also, where did you find the code?
I see. If i would want add more things like this, i should go to see some specific part of the code then. Also, where did you find the code?
The code is from Buffs and States Core. I had to look at it and MOG_ChronoEngine and modify it to apply to the ChronoEngine executeDamageCN function. The ChronoEngine function itself is the same as the core engine's executeDamage function with only a couple lines added.
The code is from Buffs and States Core. I had to look at it and MOG_ChronoEngine and modify it to apply to the ChronoEngine executeDamageCN function. The ChronoEngine function itself is the same as the core engine's executeDamage function with only a couple lines added.
I´ll keep that in mind. Thank you again.

Original thread: https://forums.rpgmakerweb.com/threads/thornmail-in-chrono-engine.166619/