I need help in my repl

Question:
The part i am struggling with is supposed to create a powerup. i already got the creating part. however, i am trying to make it only last for 10 seconds. that is not working. plz help.
Repl link:
https://replit.com/@shreemanickaraj/Pygame-Zero#main.py
the parts of the code were split apart so u will need to go to my repl link. here is the whole piece of code:


import pgzrun
import pgzrun
import time
from random import randint
from pgzhelper import *
WIDTH=800
HEIGHT=600
pygame.display.set_caption('Zombie Running')

powerup_duration_limit=10
powerup_active = False
powerup_start_time = 0




spikeD=Actor('filled_rect_surface.png')
spikeC=Actor('filled_rect_surface2.png')
spikeB=Actor('filled_rect_surface3.png')
spikeA=Actor('filled_rect_surface4.png')


spikeD.x=randint(200,500)
spikeD.y=500


spikeC.x=randint(200,500)
spikeC.y=500


spikeB.x=randint(200,500)
spikeB.y=500


spikeA.x=randint(200,500)
spikeA.y=500

lst=[spikeD,spikeC,spikeB,spikeA]

gameover=False
score=0







alien_1=Actor('alien_1')
alien_1.x=200
alien_1.y=700
alien_1.gravity=0.1
alien_1.vy=0

alien_1.fps=24

zombie=pygame.Surface(alien_1.size)
zombie.fill((0, 0, 250))
pygame.image.save(zombie, "zombie.png")

alien_1.image="zombie"

def spawn_random_spike():
  random_index = randint(0, 3)
  return lst[random_index]
spike = spawn_random_spike()
spike.x = WIDTH
spike.y=500# Set initial x position to the right end of the screen


drawing=False


def on_key_down(key):
  global powerup_active, powerup_start_time
  if key == keys.F:
      powerup_active = True
      powerup_start_time=time.time()
  elif key == keys.SPACE and drawing and alien_1.y == 500 and alien_1.vy == 0:
      alien_1.vy = -10  # Increase the jump velocity when both F key and Space key are pressed
  else:
      if key == keys.SPACE and alien_1.y == 500 and alien_1.vy == 0:
          alien_1.vy = -7
def select_random_spike():
  random_index = randint(0, 3)
  return lst[random_index]

  

  


def update():
  global gameover, score, spike, powerup_duration, powerup_active
  alien_1.vy+=alien_1.gravity
  alien_1.y+=alien_1.vy
  if alien_1.y>500:
    alien_1.y=500
    alien_1.vy=0
  random=randint(0, 3)

  spike_x_adjusted = spike.x + 20  # Adjusted x-coordinate of the spike
  spike_y_adjusted = spike.y + 10  # Adjusted y-coordinate of the spike
  spike_width_adjusted = spike.width - 40  # Adjusted width of the spike
  spike_height_adjusted = spike.height - 20  # Adjusted height of the spike
  alien_x_adjusted = alien_1.x + 20  # Adjusted x-coordinate of the alien
  alien_y_adjusted = alien_1.y + 10  # Adjusted y-coordinate of the alien
  alien_width_adjusted = alien_1.width - 40  # Adjusted width of the alien
  alien_height_adjusted = alien_1.height - 20  # Adjusted height of the alien
  spike.x -= 1  # Move the current spike to the left
  if spike.x < 0:  # When the spike reaches the left end of the screen
      spike = spawn_random_spike()  # Spawn a new random spike
      spike.y = 550
      spike.x = WIDTH  # Set the new spike's initial x position to the right end of the screen
  # Check for collision using the adjusted bounding boxes
  if (alien_x_adjusted < spike_x_adjusted + spike_width_adjusted and
      alien_x_adjusted + alien_width_adjusted > spike_x_adjusted and
      alien_y_adjusted < spike_y_adjusted + spike_height_adjusted and
      alien_y_adjusted + alien_height_adjusted > spike_y_adjusted):
      gameover = True

  if spike.x < 1:
      score += 1
  # Set game over condition when the alien falls below the screen
  if alien_1.y > HEIGHT:
      gameover = True
  if powerup_active:
    # Check if the powerup duration limit has been exceeded
    current_time = time.time()
    if current_time - powerup_start_time > powerup_duration_limit:
        powerup_active = False  # Disable the powerup after the duration limit is reached


def draw():
  global score, powerup_active
  if powerup_active:
    screen.draw.text('Powerup activated!', (200, 200), color=(0, 255, 0))

  elif gameover==True:

    screen.fill((45, 252, 3))
    screen.draw.text('GAME OVER!', (WIDTH/2, HEIGHT/2), fontsize=50, color=(252, 3, 78))
    screen.draw.text('Score: '+str(score), (450, 350), fontsize=30, color=(252, 3, 78))

  else:
    screen.draw.text('Powerup not activated!', (200, 200), color=(0, 255, 0))
    screen.clear()
    alien_1.draw()
    spike.draw()
    screen.draw.text('Score: ' + str(score), (10, 10), fontsize=20, color=(255, 0, 0))








pgzrun.go()