How to implement RPG game's buff system?

Most all of RPG game has buff/debuff system.

How to implement those?

  1. Those functions,
    Make each buff as one class? or just one function void? or?

  2. Being in effect and expiration,
    Most buffs are related on time (either realtime or turn).
    How to implement? Event? or?

It’s hard for me or anyone to give you a straight answer, because every RPG developer have their own Game architecture from the player stats system to the combat system to the item system to the inventory system and then buff/debuff system on top of that the save/load system. every system muss work together.

My only advice is to fine a tutorial how to make a RPG game that implement all of those system from same teacher / YouTuber. it’s doesn’t matter 2D or 3D since it has nothing to do with Character controller or Animation.

but tbh lean to be a very good c# coding is better than lean how to create game features, because once you are confident with your coding skill you just end up create you own Game architecture for yourself.

my buff/debuff is tied to my “use item event system”
for example using HP-Potion that generate 20hp for 10sec or a potion that increase Max-Health 20

if you already have “use item system” you should have an idea how I’m going with this.