Great to see new people getting interested in microcontrollers :).
First, you have resistors in there too right?
Anyway.
You can change 'timer' in the loop as you like. For example:
void loop() {
// loop from the lowest pin to the highest:
for (int thisPin = 2; thisPin < 6; thisPin++) {
// turn the pin on:
digitalWrite(thisPin, HIGH);
delay(timer);
// lower the delay if timer >= 20
if (timer >= 20) {
timer = timer - 10;
}
// turn the pin off:
digitalWrite(thisPin, LOW);
}
}
This will lower 'timer' by 10 each time the loop runs until 'timer' is 10 (milliseconds).
Have fun!