How to convert a Mouse Input Combo System to Button?

Hi, I have a combo system from Colenderp’s video. I was wondering how I’d convert it from inputs to UI Button inputs? So instead of clicking inputs on the mouse, i want to click a button. Here is the video: Create a Fighting Combo System in Unity! - YouTube

Here is the code:

using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;

public enum AttackType {  heavy = 0, light = 1};
public class fightingCombo : MonoBehaviour
{
    [Header("Attacks")]
    public Attack heavyAttack;
    public Attack lightAttack;
    public List<Combo> combos;
    public float comboLeeway = 0.25f;

    Attack curAttack = null;
    ComboInput lastInput = null;
    List<int> currentCombos = new List<int>();
    float timer = 0;
    float leeway = 0;
    bool skip = false;

    void PrimeCombos()
    {
        for (int i = 0; i < combos.Count; i++)
        {
            Combo c = combos*;*

c.onInputted.AddListener(() =>
{
//call funtion for combos attack
skip = true;
Attack(c.comboAttack);
ResetCombos();
});
}
}

void Update()
{
if (curAttack != null)
{
if (timer > 0)
{
timer -= Time.deltaTime;
}
else
{
curAttack = null;
}
return;
}

if (currentCombos.Count > 0)
{
leeway += Time.deltaTime;
if (leeway >= comboLeeway)
{
if (lastInput != null)
{
Attack(getAttackFromType(lastInput.type));
lastInput = null;
}
ResetCombos();
}
}
else
{
leeway = 0;
}

ComboInput input = null;
if (Input.GetMouseButtonDown(1))
input = new ComboInput(AttackType.heavy);
if (Input.GetMouseButtonDown(0))
input = new ComboInput(AttackType.light);

if (input == null) return;
lastInput = input;

List remove = new List();
for (int i = 0; i < currentCombos.Count; i++)
{
Combo c = combos[currentCombos*];*
if (c.continueCombo(input))
leeway = 0;
else
{
remove.Add(i);
}
}

if (skip)
{
skip = false;
return;
}

for(int i = 0; i < combos.Count; i++)
{
if (currentCombos.Contains(i)) continue;
if (combos*.continueCombo(input))*
{
currentCombos.Add(i);
leeway = 0;
}

}

foreach (int i in remove)
currentCombos.RemoveAt(i);
if (currentCombos.Count <= 0)
Attack(getAttackFromType(input.type));
}

void ResetCombos()
{
leeway += Time.deltaTime;
for (int i = 0; i < currentCombos.Count; i++)
{
Combo c = combos[currentCombos*];*
c.ResetCombo();
}

currentCombos.Clear();
}

void Attack(Attack att)
{
curAttack = att;
timer = att.length;
}

Attack getAttackFromType(AttackType t)
{
if (t == AttackType.heavy)
return heavyAttack;
if (t == AttackType.light)
return lightAttack;
return null;
}

}

[System.Serializable]
public class Attack
{
public string name;
public float length;
}

[System.Serializable]
public class ComboInput
{
public AttackType type;

public ComboInput(AttackType t)
{
type = t;
}

public bool isSameAs(ComboInput test)
{
return (type == test.type);
}
}

[System.Serializable]
public class Combo
{
public List inputs;
public Attack comboAttack;
public UnityEvent onInputted;
int curInput = 0;

public bool continueCombo(ComboInput i)
{
if(inputs[curInput].isSameAs(i))
{
curInput++;
if(curInput >= inputs.Count) //finished inputs and shld do attack
{
onInputted.Invoke();
curInput = 0;
}
return true;
}
else
{
curInput = 0;
return false;
}
}

public ComboInput currentComboInput()
{
if (curInput >= inputs.Count) return null;
return inputs[curInput];
}

public void ResetCombo()
{
curInput = 0;
}
}
Sorry for the long code, but ive been looking into this for a while now, with no help. Any help would be very greatly appreciated.

Well, why should it be a problem, to have a reference of a method from this script on a UI Button, changing a Variable (a bool perhaps) to indicate the Input on the UI Button for your Script? I don’t understand your issue… You know how UI buttons work right? Br