shooting rate and channeling timers

Hello dear community!

I would like to make 1st person shooter about a mage. If you press Mouse button 1 - fireballs are fired, if you press button 2 - pyroblast starts to grow and after 2 seconds of growing - is fired. I plan to have at least 1 second to register button presses (fire rate)(pyroblast takes 2 seconds to grow, so basically in this case there is no lag and consecutive button press can be registered straight afterwards if mana is available). There is full mana at the beginning (4 mana points). Fireballs reduce mana points by 1, pyroblast by 4.

The following script is almost working, but there are some problems:

  1. if MB1 is pressed a game registers to many fireballs - as if MB1 was pressed many times, probably Update() issue
  2. if MB2 is pressed - pyroblast is released but grows continuously till another one is fired.

Could you please suggest, how it is possible to cope with those difficulties? Thank you very much!
using UnityEngine;
using System.Collections;

public class shoot3 : MonoBehaviour {

		
		public Camera cam;
		public GameObject theBullet; //ordinary fireball
		public GameObject theBullet2; //pyroblast
		public GameObject bullet_prefab; //both fireball and pyroblast use the same prefab, only pyroblast gets bigger
		public float bulletImpulse = 20f;
		
		public Rigidbody g2; //to make pyroblast rigid when fired
		
		public float fireRate = 1f; //at least 1 second between any (Mouse 1 or Mouse 2) consecutive button presses
		public float timer;
		public float pyroblastchanneltimer = 2f; //it takes 2 seconds to to grow pyroblast
		
		public imagescript link; //link to a script containing mana points (max 4 mana points) (there is full mana at the beginning)

		// Set the values for scale factor with which you want your fireball to grow on each axis over time.
		public Vector3 scaleFactor = new Vector3(5,5,5);
	

		void Update()
		{
			timer += Time.deltaTime;
			if(timer > fireRate)		{

					//fire ordinary fireballs on MBT1 press	
					if (!Input.GetButton ("Fire2")) { 	//to prevent both Mouse button press
							if (Input.GetButton ("Fire1")) {
								if(link.numberofactive >= 1){ //if at least 1 mana point is available
									link.numberofactive -- ; //reduce mana points by 1
									Debug.Log(link.numberofactive);
									theBullet = (GameObject)Instantiate (bullet_prefab, cam.transform.position + cam.transform.forward, cam.transform.rotation);
									theBullet.GetComponent<Rigidbody>().AddForce (cam.transform.forward * bulletImpulse, ForceMode.Impulse);
									timer = 0; // reset fire rate timer
								}
							}
						}
						


					//fire pyroblast on MBT2 press, these balls will take 2 seconds to channel
					if (!Input.GetButton ("Fire1")) { 		//to prevent both Mouse button press
							if (Input.GetButtonDown ("Fire2")) {						
								if(link.numberofactive >= 4){ //if all mana points are available
									theBullet2 = (GameObject)Instantiate (bullet_prefab, cam.transform.position + cam.transform.forward, cam.transform.rotation);
									link.numberofactive = 0; //reduce all mana points
									timer = 0; // reset fire rate timer
									theBullet2.transform.parent = this.transform; //make pyroblast a child object of the player, to be able to move with the player's movement
									theBullet2.GetComponent<SphereCollider> ().enabled = false; //prevent collision while channeling and not fired

								}
							}
						}
						

										if (theBullet2 != null) { //if we instantiated the pyroblast
					
												pyroblastchanneltimer -= Time.deltaTime;
													bool preventfurtherscale = false;
													if (!preventfurtherscale){
															theBullet2.transform.localScale += scaleFactor * Time.deltaTime; //scale
															Debug.Log (pyroblastchanneltimer);
													}					
														if (pyroblastchanneltimer <= 0) { //if 2 seconds to grow pyroblast passed
														preventfurtherscale = true;
														theBullet2.transform.parent = null; // unparent pyroblast
														theBullet2.GetComponent<SphereCollider> ().enabled = true;
														g2 = theBullet2.AddComponent<Rigidbody> ();
														theBullet2.GetComponent<Rigidbody>().AddForce (cam.transform.forward * bulletImpulse, ForceMode.Impulse);
														pyroblastchanneltimer = 2.0f; //reset pyroblast timer
													}
										
										}
			}

	}
			
}

Nerevar, thanks for help! I made the following script, which works as intended:

using UnityEngine;
using System.Collections;

public class shoot5 : MonoBehaviour {

		
		
		public Camera cam;
		public GameObject theBullet; //ordinary fireball
		public GameObject theBullet2; //pyroblast
		public GameObject bullet_prefab; //both fireball and pyroblast use the same prefab, only pyroblast gets bigger
		public float bulletImpulse = 20f;

		public Rigidbody g1; //to make fireball rigid when fired
		public Rigidbody g2; //to make pyroblast rigid when fired

		
		public float fireRate; //at least 1 second between any (Mouse 1 or Mouse 2) consecutive button presses
		public float timer; //calculates time since Update, 0 at the end of every shot
		public float pyroblastchanneltimer; //it takes 2 seconds to to grow pyroblast
		
		public imagescript link; //link to a script containing mana points (max 4 mana points) (there is full mana at the beginning)
		
		// Set the values for scale factor with which you want your fireball to grow on each axis over time.
		public Vector3 scaleFactor = new Vector3(5,5,5);

		public bool lockvariable;

		public bool readytoinstantiate;
		public bool readytoinstantiate2;
		
		

		
		void Start()
		{
			fireRate = 1;
			pyroblastchanneltimer = 2;
			readytoinstantiate = true;
			readytoinstantiate2 = true;
		}
		
		void Update()
		{
				timer += Time.deltaTime;
				if (timer > fireRate) {
			
						//fire ordinary fireballs on MBT1 press    
						if ((Input.GetButtonDown ("Fire1")) && (readytoinstantiate)) {
										if (link.numberofactive >= 1) { //if at least 1 mana point is available
												link.numberofactive --; //reduce mana points by 1
												Debug.Log (link.numberofactive);
												theBullet = (GameObject)Instantiate (bullet_prefab, cam.transform.position + cam.transform.forward, cam.transform.rotation);
												readytoinstantiate2 = false;							
												g1 = theBullet.AddComponent<Rigidbody> ();						
												theBullet.GetComponent<Rigidbody> ().AddForce (cam.transform.forward * bulletImpulse, ForceMode.Impulse);
												timer = 0; // reset fire rate timer
												readytoinstantiate2 = true;
										}
								}
						

						if ((Input.GetButtonDown ("Fire2")) && (readytoinstantiate2)) {	
			
								theBullet2 = (GameObject)Instantiate (bullet_prefab, cam.transform.position + cam.transform.forward, cam.transform.rotation);
								readytoinstantiate = false;				
								theBullet2.transform.parent = this.transform; //make pyroblast a child object of the player, to be able to move with the player's movement
								theBullet2.GetComponent<SphereCollider> ().enabled = false; //prevent collision while channeling and not fired
								lockvariable = true;
								readytoinstantiate2 = false;			
						}
			
						if (lockvariable) {
								pyroblastchanneltimer -= Time.deltaTime;
								if (pyroblastchanneltimer > 0) {
										theBullet2.transform.localScale += scaleFactor * Time.deltaTime; //scale
								}

								if (pyroblastchanneltimer <= 0) {
										Debug.Log ("timer is 0");
										Debug.Log ("shooting now");
										theBullet2.transform.parent = null; // unparent pyroblast
										theBullet2.GetComponent<SphereCollider> ().enabled = true;
										g2 = theBullet2.AddComponent<Rigidbody> ();
										theBullet2.GetComponent<Rigidbody> ().AddForce (cam.transform.forward * bulletImpulse, ForceMode.Impulse);
										lockvariable = false;
										pyroblastchanneltimer = 2;
										readytoinstantiate2 = true;
										readytoinstantiate = true;	
										timer = 0;
								}
				
						}
				}
		}
	}