Set Timer for each event individually

Hello Dear Community,

I want to add bonuses to my character individually seperated from others which took 10 secs.
Assume that you character collecting bonus, like 2x point and 2x speed.

2x point collection is in time T1

2x speed collection is in time T2

Since you collect both of them between (T2 - T1) = 5 seconds. So 2x point bonus will deplete after 5 second after you collect 2x speed bonus.

For that purpose I have created a TMap which includes TimerDelegate and its own deplete time as float.

        FTimerHandle TimerHandle;
        FTimerDelegate TimerDelegate;
        
        FBonusTimerHandle* BonusTimerDelegate = new FBonusTimerHandle();
        BonusTimerDelegate->ActiveTimerHandle = TimerHandle;
        BonusTimerDelegate->RemainingTime = BonusDuration;

        TimerDelegate.BindUFunction(this, FName("DepleteBonus"), BonusType);
        GetWorldTimerManager().SetTimer(TimerHandle, TimerDelegate, 0.01f, true);

here is my deplete function

void AEBallGameMode::DepleteBonus(ConsumableBonusType BonusType)
{
    auto* ActivePowerUp = &(ActivePowerUps[BonusType]);
    ActivePowerUp->RemainingTime -= 0.01f;

    UE_LOG(LogTemp, Warning, TEXT("--Depleting Bonus : %f--"), ActivePowerUp->RemainingTime);
    if (ActivePowerUp->RemainingTime <= 0.f)
    {
        GetWorldTimerManager().ClearTimer(ActivePowerUp->ActiveTimerHandle);
        RemoveBonus(BonusType);
        AddBonusWidget(BonusType, false);
    }
}

Question is ClearTimer is not working. Why?

I have solved my issue

When delegating, I sent wrong referanced timer handle rather than my handle inside of my map.

Revised first part as

FBonusTimerHandle* BonusTimerDelegate = new FBonusTimerHandle();
BonusTimerDelegate->RemainingTime = BonusDuration;

FTimerDelegate TimerDelegate;
TimerDelegate.BindUFunction(this, FName("DepleteBonus"), BonusType);
GetWorldTimerManager().SetTimer(BonusTimerDelegate->ActiveTimerHandle, TimerDelegate, 0.01f, true);

ActivePowerUps.Add(BonusType, *BonusTimerDelegate);

I hope this question helps anyone out here.