Modulo is very helpful for this. Modulo is the % sign, and it represents the remainder of a number divided by another number. 7 divided by 4 equals 1, but has a remainder of 3; 8 divided by 4 equals 2, but has a remainder of 0. It sounds complex but it's not actually that bad.
The double slashes below (//) represents a comment; anything after it is me explaining stuff.
if (i % 4 == 0) //triggers if i equals 0, 4, 8, 12, 16...
if (i % 4 == 1) //triggers if i equals 1, 5, 9, 13, 17...
if (i % 4 == 2) //triggers if i equals 2, 6, 10, 14, 18...
if (i % 4 == 3) //triggers if i equals 3, 7, 11, 15, 19...
if (i % 5 == 0) //triggers if i equals 0, 5, 10, 15, 20...
if (i % 5 == 1) //triggers if i equals 1, 6, 11, 16, 21...
++i; //Adds 1 to i. Same as i++, but it runs faster.
i%=30; //this will wrap i to a value between 0 and 30; once it reaches or goes over 30 it wraps back around to 0. 31 becomes 1, 62 becomes 2, etc.
So if you want something to happen every 60 frames... How would you do that using what I posted above?