[SerializeField]
private float cooldown = 1f;
private float nextUseTime;
void Update()
{
if (attackAction.action.WasPressedThisFrame() &&
Time.time >= nextUseTime)
{
Attack();
nextUseTime =
Time.time + cooldown;
}
}