Damage/Healing over time

After referencing numerous relevant scripts in a attempt to Frankestein my own to life I have hit a wall. My intention is to have the player affected by the health modifiers over time instead of an instance as it currently set. I believe it requires OnTriggerEnter and OnTriggerExit and possibly something to do with Time.deltatime?

Just starting out with Unity programming so please forgive my ignorance any help or insight would be greatly appreciated.

var playerHealth = 100;
    function Update () {
        if(playerHealth <= 0){
            playerHealth = 0;
            killPlayer();
            }

function OnTriggerEnter (other : Collider){
	if (other.gameObject.CompareTag("Black Orbit"))
		{
		playerHealth -= 2;
		}
	if (other.gameObject.CompareTag("White Orb"))
		{
		playerHealth += 1;
		}}

I normally use c# but try :

{
playerhealth = playerhealth - Time.deltaTime;
}

And switch OnTriggerEnter to OntriggerStay
Thats if u only want it to subtract health when on contact with that object.
If you want it to constantly lose health:

if(other.gameObject.CompareTag("Black Orb"))
{
damaging = true;
}

if(damaging == true)
{
playerhealth = playerhealth - Time.deltaTime;
}

Try that! Sorry if this doe not work, I’m on a mobile right now and can’t check.