GameplayAbilities and you

I configured a GameplayAbility with a GameplayEffect as cooldown. It’s working well but now I want to get the cooldown time to show on the UI.
I am trying to use the function GetCooldownTimeRemaining() but it always returns 0. To get the UGameplayAbility I use this:


	FGameplayAbilitySpec* AbilitySpec = AbilitySystem->FindAbilitySpecFromClass(Ability);

	if (AbilitySpec && AbilitySpec->Ability)
	{
		float TimeRemaining = AbilitySpec->Ability->GetCooldownTimeRemaining();
		UE_LOG(LogTemp, Warning, TEXT("Time Remaining %f"), TimeRemaining);
	}


I assume that this is incorrect. How I obtain the GameplayAbility correctly to get the cooldown?