Best bet is to use a Global variable for this I think.
Each time you shoot, add 1 to the variable.
On the final shot, reset it.
So your event would be something like:
On Mouse click & BallNum==1 -- Shoot Blue & add 1 to BallNum
On Mouse click & BallNum==2 -- Shoot Green & add 1 to BallNum
On Mouse click & BallNum==3 -- Shoot Red & set BallNum to 1