Need help adding cooldown to my /motor command

Hey, I want to add a cooldown to my /motor command, but I just don’t know how to. Could anyone help me, I want to add if you send the command after each other under a minute you get a message saying you still have to wait the amount of seconds to wait. Here’s the code of the client.lua file:

-- Shows a notification on the player's screen 
function ShowNotification( text )
    SetNotificationTextEntry("STRING")
    AddTextComponentSubstringPlayerName(text)
    DrawNotification(false, false)
end

RegisterCommand('motor', function(source, args, rawCommand)
    local x,y,z = table.unpack(GetOffsetFromEntityInWorldCoords(PlayerPedId()))
    local veh = "Faggio2" 
    local playerPed = PlayerPedId()
    vehiclehash = GetHashKey(veh)
    RequestModel(vehiclehash)
    
    Citizen.CreateThread(function() 
        local waiting = 0
        while not HasModelLoaded(vehiclehash) do
            waiting = waiting + 100
            Citizen.Wait(100)
            if waiting > 5000 then
                ShowNotification("~r~Daddy chill zometeen crashed je computah")
                break
            end
        end
        local vehicle = CreateVehicle(vehiclehash, x, y, z, GetEntityHeading(PlayerPedId())+90, 1, 0)
        SetPedIntoVehicle(playerPed, vehicle, -1)
    end)
end)



Here you go.

local cooldown = false
local cooldown_timer = 60000

CreateThread(function()
    while true do
        Wait(1000)
        if cooldown then
            if cooldown_timer >= 1000 then
                cooldown_timer = cooldown_timer - 1000
            else
                cooldown = false
                cooldown_timer = 60000
            end
        end 
    end
end)

-- Shows a notification on the player's screen 
function ShowNotification( text )
    SetNotificationTextEntry("STRING")
    AddTextComponentSubstringPlayerName(text)
    DrawNotification(false, false)
end


RegisterCommand('motor', function(source, args, rawCommand)
    if cooldown then
        ShowNotification("Cooldown active, please wait")
    else
        local x,y,z = table.unpack(GetOffsetFromEntityInWorldCoords(PlayerPedId()))
        local veh = "Faggio2" 
        local playerPed = PlayerPedId()
        vehiclehash = GetHashKey(veh)
        RequestModel(vehiclehash)

        Citizen.CreateThread(function() 
            local waiting = 0
            while not HasModelLoaded(vehiclehash) do
                waiting = waiting + 100
                Citizen.Wait(100)
                if waiting > 5000 then
                    ShowNotification("~r~Daddy chill zometeen crashed je computah")
                    break
                end
            end
            local vehicle = CreateVehicle(vehiclehash, x, y, z, GetEntityHeading(PlayerPedId())+90, 1, 0)
            SetPedIntoVehicle(playerPed, vehicle, -1)
        end)
    end
end)

** OFF TOPIC **

ShowNotification(“~r~Daddy chill zometeen crashed je computah”)

“Daddy chill something crashed the computer”? pahahahahaha