Need to call a Class method from another object

so I have a timer class in my game, and I call it whenever I need to put something on cool-down or otherwise record some amount of time. on initialization, the timer takes parameters targTime, On, and Aft. targTime is how long the timer goes for, but on and aft are meant to correspond to methods of the main class. “On” would be a method called every time the timer is updated, and “Aft” would be called when the timer is over. Importantly, I need the “On” and “Aft” methods to be called as if they were being called from the main class, as there are some variables in the class that they would be setting the values for. I have tried a few different ways to make this work like delegates and action and they haven’t worked, though I am somewhat new to c# so it is very possible that I am just implementing those wrong. Here is what I have so far.

public class Timer
{
    public float targTime;
    public float currTime = 0;
    public (???) execOn;
    public (???) execAft;
    public Timer(float targtime, (???) On, (???) Aft)
    {
        targTime=targtime;
        execOn=On;
        execAft=Aft;
    }
    public bool ElapseTimer(float elapsed)
    {
        currTime+=elapsed;
        if(currTime>=targTime)
        {
            // Would call the "execAft" method here
            return true;
        }
        // Would call the "execOn" method here
        return false;
    }

}

public class MainClass : MonoBehaviour
{
 
    public List<Timer> timers = new List<Timer>();
    
    void UpdateTimers (float elapsed)
    {
        int curr = 0;
        while ( curr < timers.Count )
        {
            if( timers[curr].ElapseTimer(elapsed) )
            {
                timers.RemoveAt(curr);
            } 
            else
            {
                curr+=1;
            }
        }
    }
    
    void Update()
    {
        UpdateTimers(Time.deltaTime);
    }
    
}

You can use UnityEvents to do this.

Unity - Scripting API: UnityEvent (unity3d.com)

Timer class

public UnityEvent execOn = new UnityEvent(); //UnityEvent type
public UnityEvent execAft = new UnityEvent(); //UnityEvent type

...

public Timer(float targtime, UnityAction On, UnityAction Aft)
{
    targTime = targtime;
    

    execOn.AddListener(On);
    execAft.AddListener(Aft);
}

...

public bool ElapseTimer(float elapsed)
{
    ...
    if (currTime >= targTime)
    {
        // Would call the "execAft" method here
        execAft.Invoke();
        ...
    }
    // Would call the "execOn" method here
    execOn.Invoke();
    ...
}

And to add actions…

MainClass class


void Start()
{
    var timer = new Timer(3f, GoToForward, Rotate45);
    timer.execAft.AddListener(ScaleX); //Adding other action event to execAft

    timers.Add(timer);
}

private void GoToForward()
{
    Debug.Log("Translating GameObject");
    gameObject.transform.Translate(Vector3.forward);
}
private void Rotate45()
{
    Debug.Log("Rotating");
    gameObject.transform.Rotate(new Vector3(0f, 45f, 0f));
}

private void ScaleX()
{
    Debug.Log("Scaling");
    gameObject.transform.localScale = new Vector3(4f, 1f, 1f);
}

You can use event Action too and delegates, but UnityEvent have integration with editor.