Help with displaying gained EXP on screen.

I’m trying to write a script that displays the amount of exp points the player has earned in the last 3.5 seconds on the screen using a script. I managed to create a script that showed the exp they just gained but this overwrites the exp they gained beforehand. For example, if i earned 20 exp, then 10 more within a second, it will just display 10. I;m trying to code something so it would stack that 20 and 10, display it and if no more exp is earned within a few more seconds, it will reset back to 0 and hide.

public TMPro.TMP_Text expIncrementUI;

private void Start()
    {

        GameObject player = GameObject.Find("Player"); 

        PlayerData playerData = player.GetComponent<PlayerData>();


        previousCurrentEXP = playerData.currentEXP;

    }

void OnGUI()
    {


        EXPIncrement();

    }

void EXPIncrement()
    {

        GameObject player = GameObject.Find("Player"); 

        PlayerData playerData = player.GetComponent<PlayerData>(); 


        if (playerData.currentEXP != previousCurrentEXP)
        {


            StartCoroutine(EXPCombo());


        }

IEnumerator EXPCombo()
    {

        GameObject player = GameObject.Find("Player"); 

        PlayerData playerData = player.GetComponent<PlayerData>(); 


        expGaining += playerData.currentEXP - previousCurrentEXP;

        oldEXPGaining = expGaining;

        expIncrementUI.enabled = true;


        expIncrementUI.text = "+" + (expGaining).ToString();


        yield return new WaitForSeconds(3.5f);

        if (oldEXPGaining == expGaining)
        {

            expGaining = 0;

            expIncrementUI.enabled = false;

            previousCurrentEXP = playerData.currentEXP;

        }




    }


}

The error i am recieving is the fact this code keeps on adding exp after the first amount of exp is gained, so the numbers keep rising and rising and never stops.

Something like this maybe? I used two variables for EXP, a temporary and total. Every couple seconds the temporary one will dump into the total and reset. In the meantime the update function keeps updating the current EXP (unless its less than zero, in which case it will hide).

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI; 

public class ExpExample : MonoBehaviour {

    //When adding EXP for completing an objective add value to the temporaryEXP var, ie
    //temporaryEXP += 6; 

    public int totalEXP;        //Total EXP the character has. 
    public int temporaryEXP;    //Temporary exp at 3.5 second intervals
    bool displayingEXP;         

    public Text displayEXP;     //Display text output. 

    private void Start()
    {
        displayingEXP = true;     //Initialize Vars//
        totalEXP = 0;
        temporaryEXP = 0; 

        StartCoroutine(ResetEXP());    //Start Looping// 
    }

    private void Update()
    {
        if(temporaryEXP > 0)  
        {
            displayEXP.enabled = true; 
            displayEXP.text = temporaryEXP.ToString();
        }
        else
        {
            displayEXP.enabled = false; 
        }

    }

    public IEnumerator ResetEXP()
    {
        while(displayingEXP == true)
        {
            yield return new WaitForSeconds(3.5f);
            totalEXP += temporaryEXP;                 
            temporaryEXP = 0;                              
        }
    }
}