How to undo cancel Invoke

So I use invoke repeating until a certain number is reached and then cancel the invoke. But is tere any syntax in JS to “reinvoke repeating” FROM A SEPARATE SCRIPT? Thank you for your time and any helpful pointers, ideas, and tutorials would be very helpful. Note this is for spawning zombies(just experimental, there are probably better ways to code this). Here is my code so far…

 	var SpawnObject : GameObject;  
var player : Transform;
private var SpawnStartDelay : float = 0; 
var SpawnRate : float = 1.0; 
private var amountOfE : float = 0;
var maxAmount : float = 10; 
var distance = 15; 
var playerCloseEnough = false;
var delay:float;
function Start() 
{
    AttackDelay();
} 
function AttackDelay()
{
 		var timePointer:float=Time.time+delay;
 		for(;timePointer>Time.time;)
 		yield;
 		InvokeRepeating("Spawn", SpawnStartDelay, SpawnRate); 
 	}
// Spawn the SpawnObject 
function Spawn() 
{
    amountOfE++;
    Instantiate(SpawnObject, transform.position + (transform.forward * 5.0f), transform.rotation);
}
   
function Update()
{
    if(amountOfE == maxAmount)
        {
             CancelInvoke("Spawn");
             amountOfE = 0;
        }
        else{}
}

Attack delay is public so if you use

 objectThatHasTheScript.GetComponent.<SpawnObject>().AttackDelay();

wich will call the function i do not know what the name of the object that the scripted is attached to is called so i used objectThatHasTheScript