Here is an old example you should be able to apply in your situation:Gun example
If you take the first few events and simplify them for one weapon, you'll have what you want. It's basically the same idea as before, you'll add dt to a variable until it is greater than the fire rate, when it is the gun fires. Then you set the variable to 0 and start all over again.
Like I said before, you are missing the 'for each enemy' from the point where enemies fire; if you don't have 'for each' every ship will take fire rate variable from the first instance of enemy ships. :)