public override int OverrideStatusEffectApplicationToOwner(
            AbstractStatusEffect statusEffectApplied,
            int numStacksApplied)
        {
            if (numStacksApplied < 0)
            {
                return(numStacksApplied);
            }

            if (this.Stacks <= 0) // if we're removing stress, we're not modifying that
            {
                this.Stacks = 0;
                return(numStacksApplied);
            }

            if (statusEffectApplied.GetType() == typeof(StressStatusEffect))
            {
                var stacksToRemove = 0;
                if (numStacksApplied > this.Stacks)
                {
                    stacksToRemove = this.Stacks;
                    this.Stacks    = 0;
                    return(numStacksApplied - stacksToRemove);
                }
                if (Stacks >= numStacksApplied)
                {
                    Stacks -= numStacksApplied;
                    return(0);
                }
            }
            return(numStacksApplied);
        }
    public static void ProcessHooksWhenStatusEffectAppliedToUnit(AbstractBattleUnit unitAffected, AbstractStatusEffect effectApplied, int stacksAppliedOrDecremented)
    {
        foreach (var status in unitAffected.StatusEffects)
        {
            var incOrDec = StatusEffectChange.DECREASE;

            if (stacksAppliedOrDecremented > 0)
            {
                incOrDec = StatusEffectChange.INCREASE;
            }

            if (status.GetType() == effectApplied.GetType())
            {
                if (incOrDec == StatusEffectChange.INCREASE)
                {
                    status.OnApplicationOrIncrease();
                }
            }
            else
            {
                stacksAppliedOrDecremented = status.OverrideStatusEffectApplicationToOwner(effectApplied, stacksAppliedOrDecremented);
            }
        }
    }