Trouble telling Unity when to do things

I am having some trouble getting unity to do things in the order that I want them done. I have a fall damage system worked out, but it subtracts your health when you in the air. I don’t understand how to make it apply the damage once you have hit the ground.

verticalMove = Vector2(rigidbody.velocity.y, 0);
	if(verticalMove.magnitude > triggerFall)
	{	
		var speed = verticalMove.magnitude;	
		var damage = damagePerFall * verticalMove.magnitude;
		
		var otherScript : Health = GetComponent(Health);
		otherScript.health -= damage;
	}

Oh lol… you must be new… ok… see you need to calculate the damage, then take the damage when you hit the ground after you have determined if the player will even receive damage. OnCollisionEnter works when something collides (like the ground and the player) so if you put all of your code in it it will obviously do nothing. I would do something like this:

var verticalMove : Vector2;
var fallDamageFlag : Boolean;
function Update {

verticalMove = Vector2(rigidbody.velocity.y, 0);
    if(verticalMove.magnitude > triggerFall)
    {  

         fallDamageFlag  = true;
 
    }

}
function CalculateDamage() : int {

       var speed = verticalMove.magnitude;   
       var damage = damagePerFall *speed;
         return speed

}

function OnCollisionEnter(collision : Collision) {

       var otherScript : Health = GetComponent(Health);
       if (fallDamageFlag) {
           otherScript.health -=  CalculateDamage();
        }

       

}

if you copy this it may have an error since my Unity Script(aka Javascript) syntax is rather rusty, but you get the idea of how it should work or how its done.