Problem Draining Energy Float When Sprinting

I’m making a multiplayer game where the players can sprint and I can not get the energy float to go down when sprinting. Players start with 100 energy and I want it to go down by 10 by deltatime. this is my current script. I’ve looked everywhere and have tried almost everything.

using UnityEngine;
using System.Collections;

public class SprintScript : MonoBehaviour {
	
	private float walkSpeed = 7;
	private float sprintSpeed = 13;
	
	private CharacterMotor cMotor;
	private CharacterController cController;

	//Used in affecting the player's energy.
	private PlayerEnergyScript energyScript;
	private float energyCost = 10;
	
	// Use this for initialization
	void Start () {
		if (networkView.isMine == true) {
			energyScript = transform.GetComponent<PlayerEnergyScript>();
			cMotor = transform.GetComponent<CharacterMotor>();
			cController = transform.GetComponent<CharacterController>();
		}
		else {
			enabled = false;
		}
	}
	
	// Update is called once per frame
	void Update () {
		float speed = walkSpeed;
		if(cController.isGrounded && Input.GetButton("Sprint") && energyScript.energy >= energyCost) {
			speed = sprintSpeed;
			DrainEnergy();
		}
		cMotor.movement.maxForwardSpeed = speed;
	}

	void DrainEnergy () {
		energyScript.energy -= energyCost * Time.deltaTime;
	}

}

Maybe my stamina script can inspire you.

    public void StaminaDecrement()
	{
		stamina = stamina + Time.deltaTime * 5;
		if (stamina >= 100 && isDead == false)
		{
			Die();
		}
	}

This one is starting at stamina = 0 though. And then counting upwards towards 100 where the player will die if it reaches that.