How do I make a Status Effects system in a Turn-Based Combat RPG?

I need help to make a status effect system for my turn based combat RPG. I’m new to delegates and events and am only familiar with basics of unity and know C#. Basically, I have two Scriptable Objects each containing functions for players’ behaviors and enemies’ behaviors. I also have a script containing Character statuses. When an action button is clicked by the player or when the Enemy AI chooses an action for their particular turns, and I want some of the actions of particular character to initiate certain effects on certain character or themselves. For example, if the player uses a Defense BUFF, all damage taken should reduce by 30% or if Magic BUFF is used, Mana consumption should be reduced by a 30% for a certain number of turns, and if a character casts a DEBUFF on the opponent, like a Health DEBUFF, then the opponent will lose 30HP every turn for a certain number of turns. Can someone please help me figure out the best method for me to do that?

It helps me to first try to describe what I am doing in plain english.

So I might say, when Character A does special action, send out a message so that others can know he did so.

Then the others first need a reference so they can recognize character A, then they just need to be looking out for that message. When that message does go out, they have an event/function waiting which describes what they will do.

The easy way to design your system is to build it first using only debug logs. Get the communication channels set up, then all you got to do is fill in the details.

Whatever works for you.

One way is to store list of records for each active effect on each object object, where for each active effect on that object there will be a reference to a scriptableobject determining effect’s actual effect, and how long till it disappears.

For example, a “health buff” could add 50 points to max HP when it is aded, and remove 50 points from max HP when it is removed. This can be parametrized.

Status effect base class that have OnInflict, OnTurnBegin, OnTurnEnd, OnRemoved. (Each are triggered from your unit or game manager). Then you just need to inherit from the base class to create new status effects like poison with its own construction parameters.

For example, if you want to create stats boosters, you override and add the status bonus OnInflict, and remove them OnRemoved.

Another example, if you want to create poison, you override and inflict the damage OnTurnEnd.