How can I implement this Class Bonus system?

Hi, everyone!

In the past, I've been able to create a bonus system based on character's class during battle, but I lost this project. It was similar as class system of Marvel's Avengers Alliance, that was like:
- Defenders get double defense during 1 turn if attacks or is attacked by Fighters.
- Blasters ignores defense for 1 turn if they attack or are attacked by Defenders.
- Tacticals get an extra move and an agility bonus in a turn if they attack or are attacked by Blasters.
- Infiltrators get a bonus that counter-attacks each attack they receive for 1 turn. They get this bonus if attack or is attacked by Tacticals.
- Fighters double their ATK for 1 turn if they attack or are attacked by infiltrators.

I tried to rebuild this system with the Element core Yanfly plugin, but it doesn't seem to help me with the bonus effects. As I remember, I had to use common events to setup them, but I have no Idea on how to do this now.

I think the logic behind the code should be:
- if (user.class == tactical && target.class == blaster) { user.addState(X) };
- Else if (user.class == blaster && target.class == tactical) { target.addState(X)};
- Else if (user.class == blaster && target.class == defender) { user.addState(Y)};
- Else if....

(I suppose it works because I did it in C# for another project in Unity)

Please, can you help me? :LZSteary:

[Edit] Useful information I forgot to mention: I use RPG Maker MV and have basically all the Yanfly Engine plugins installed
I would go a different route, less coding and more traits and states.

example: a fighter attacking has every attack skill give its target a state that doubles the targets defense afterwards, but all other classes except the defenders are immune to that state.
tacticals give a state with a high counter rate of 100% but only infiltrators can get the state, others are immune to it.

some of your conditions are more difficult to recreate this way, but most should be able to go like this.
and you can still use plugins to get the missing effects.
I would go a different route, less coding and more traits and states.

example: a fighter attacking has every attack skill give its target a state that doubles the targets defense afterwards, but all other classes except the defenders are immune to that state.
tacticals give a state with a high counter rate of 100% but only infiltrators can get the state, others are immune to it.

some of your conditions are more difficult to recreate this way, but most should be able to go like this.
and you can still use plugins to get the missing effects.

Awesome! I didn't think that way, but it surely will make things easier. Thank you! 🙂

But, if I undertood it correctly, I will be able just to configure the "defensive" effects, right? I mean: I can make the attackers give these bonusses to the defenders, but how can I give the bonusses to the attackers to?

Example: how can I guarantee that a fighter will receive the fighter class bonus after attacking an infiltrator?
Bump

Original thread: https://forums.rpgmakerweb.com/threads/how-can-i-implement-this-class-bonus-system.146184/