Breaking from a Loop

What I want to happen is: if p1Fizzled = true at anytime it will stop the whole function.
The yieldwaitforseconds is my spell cast time, but if p1fizzled=true then i want it to stop casting all together. The ct variable is to make it only run once otherwise it keeps looping. Any ideas on how to get the whole function to halt when p1fizzled = true?

function CastFireball() 
  {
  	var spellLvl = 1;
  	ct = true;
  	combatIndex.isCasting = true;
  	combatIndex.spellLoaded = false;
  	while(p1Fizzled == false && ct == true)
  	{
	yield WaitForSeconds (4);
	if(combatIndex.isCasting == true && p1Spellsent == false)
	{
   	p1Lastspell =  10;
   	p1Lastmana =  10;
   	spellwait = 0;
   	combatIndex.spellLoaded = true;
   	combatIndex.CastRecovery();
   	ct = false;
   	}

break; //breaks current loop
return; //returns a value - ends function, as void does not return anything, its just return;

If you have a need to run code immediately when casting stops you may need to split your logic over a number of methods. Here is a three stage approach:

var isCasting = false;

function FireballStart() {
    isCasting = true;
    //perform start logic
    yield FireballLoop()
}

function FireballLoop() {
    while(isCasting){
        //perform loop logic 
        yield WaitForSeconds (4);
    }
}

function FireballStop() {
    isCasting = false;
    //perform stop logic
}