Disable a Function when another and active (javascript AI)

Hello,
I would like to know how to turn off the chase function when the attack function starts

thanks

#pragma strict


var Distance : float;
var Target : Transform;
var lookAtDistance : float = 20;
var chaseRange : float = 10;
var attackRange : float = 3;
var moveSpeed : float = 3;
var Damping : float = 6;
var attackRepeatTime : float = 1;

var damage : float = 10;

private var attackTime : float;

var controller : CharacterController;
var gravity : float = 20;

private var moveDirection : Vector3 = Vector3.zero;



function Start () {
attackTime = Time.time;
FindHealth();
}



function Update () {
Distance = Vector3.Distance(Target.position, transform.position);
if (Distance < lookAtDistance){
lookAt();
}

if (Distance < attackRange){
attack();
}

else if (Distance < chaseRange){
chase();
}

}


function lookAt (){
var rotation = Quaternion.LookRotation(Target.position - transform.position);
transform.rotation = Quaternion.Slerp(transform.rotation, rotation,Time.deltaTime * Damping);
}



function chase() {
GetComponent.<Animator>().Play("creature1run");
moveDirection = transform.forward;
moveDirection *= moveSpeed;
moveDirection.y -= gravity * Time.deltaTime;
controller.Move(moveDirection * Time.deltaTime);
}



function attack() {
if (Time.time > attackTime){
GetComponent.<Animator>().Play("creature1Attack2");
Target.SendMessage("PlayerDamage", damage);
Debug.Log ("The enemy has attacked");
attackTime = Time.time + attackRepeatTime;
}
}



function ApplyDamage(){
chaseRange += 30;
moveSpeed += 2;
lookAtDistance += 40;
}



function FindHealth(){
Target = GameObject.Find("Player").GetComponent(HealthScript).transform;
}

???