Dimming 4 LEDs on PWM at different rates.

I agree. You seem to have 4 functions that do much the same thing. Better to have one and pass to it which LED you want it to act on.