Health Meter Drain Over Time?

In my game the player has a sanity meter. I wish it to drain over time. If you do not complete the level fast enough then your sanity reaches zero and its game over. Could anybody help me out? It would be much appreciated!
Here is my current health code:

using UnityEngine;
using System.Collections;

public class PlayerHealth : MonoBehaviour {
public int maxHealth = 100;
public int curHealth = 100;
public string sanity = "Sanity: ";
// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {

}

void OnGUI() {
	GUI.Box(new Rect(350, 10, Screen.width / 2 /(maxHealth / curHealth), 25), sanity + curHealth + "/" + maxHealth);
}

}

Thanks in advance! So far the unity community has been extremely helpful to me and im very grateful!

So I don’t know where you would ultimately want to put this code so I just wrote it into the Update function for the sake of example.

You mentioned that you wanted it to drain as a factor of time, so in the code below, we’re setting the number of milliseconds it takes for 1 health point to drain and on each update, we’re subtracting health proportionate to the time that has passed since the last frame was drawn.

note: i always work with floats when doing stats just for the ease of use when using time and math operations then I’ll cast to an integer or round for GUI displays. You can just convert it back to integers if you don’t prefer to do this.

using UnityEngine; 
using System.Collections;

public class PlayerHealth : MonoBehaviour {
 public float maxHealth = 100.0f;
 public float curHealth = 100.0f;
 public float sanityDrainSpeed = 500.0f; //# of milliseconds for 1 Health to drop.
 public string sanity = "Sanity: ";

  void Start () {

  }
 

  void Update () {
    curHealth = Mathf.Clamp(curHealth - (Time.deltaTime * (1000 / sanityDrainSpeed)),0.0f,maxHealth);
  }
 
  void OnGUI() {
    GUI.Box(new Rect(350, 10, Screen.width / 2 /(maxHealth / curHealth), 25), sanity + curHealth + "/" + maxHealth);
  }