Cooldown between MouseClick Detection

if(Input.GetKeyDown(KeyCode.Mouse0))
{
Vector3 direction = ((Camera.main.ScreenToWorldPoint(Input.mousePosition) - transform.position).normalized) * 20f;
GameObject cloneHook = Instantiate (hook, transform.position , Quaternion.identity) as GameObject;
//cloneHook.GetComponent().AddForce (direction * speed);
rb = cloneHook.GetComponent() ;
rb.velocity = direction;
}

this is the code I use to accept mouse click and launch a projectile.
The issue is, I can spam the projectile, which makes the game easy.
But I want to add a cooldown, like a spell cooldown in MOBAs, say 4 sec, between which mouse clicks will not be detected for the this particular projectile. Is there a way to do this?

Thanks for your help

To anyone looking for an answer to this, I figured it out myself.
we have to make use of Time.time.

public float nextProjectile = 0.0f; // this is if you wish to allow projectile from                      //the beginning of the game it self.   
public float projectileCoolDown = 5.0f; // if the cooldown is say 5 secs.

void Update()
{
if (if(Input.GetKeyDown(KeyCode.Mouse0) && Time.time > nextProjectile)
{
doWhatever();
nextProjectile = Time.time + projectileCooldDown;
}
}

basically we are comparing whethere the Time.time that is the time at the beginning of frame is greater than projectileCoolDown value greater than the previous Time.time or not. Though the bug here is, if someone makes multiple clicks in that one single frame, then that many projectiles can be launched.