Help! Trying to modify Sketch

Think your goal is to let the LEDS blink one by one for 300 msec, right?

something like this?

int timer = 300;         
int ledPins[] = {5, 9, 13, 22}; 
int pinCount = 4;
int currentPin = 0;
unsigned long lastLedTime = 0;

void setup() 
{
  for (int thisPin = 0; thisPin < pinCount; thisPin++)  
  {
    pinMode(ledPins[thisPin], OUTPUT);
    digitalWrite(ledPins[thisPin], LOW);
  }
}

void loop() 
{
  if (millis() - timer > lastLedTime)
  {
    lastLedTime += timer;
    digitalWrite(ledPins[currentPin], LOW);
    currentPin = (currentPin +1 ) % pinCount;
    digitalWrite(ledPins[currentPin], HIGH);
  }
  
  // other code can be here 
}