How do I change this run script into a stamina script?

I would like to change this script to a stamina script where u can only run for like 25 seconds and when that 25 seconds is up you have to wait a little for it to comeback, but i want the run speed to very slowly decline through those 25 seconds. Here’s my script without stamina that I would like to have the stamina script implemented into

local UIS = game:GetService(‘UserInputService’)
local Player = game.Players.LocalPlayer
local TweenService = game:GetService(“TweenService”)
local Character = Player.Character
local humanoid = Character.Humanoid
local Anim = Instance.new(‘Animation’)
Anim.AnimationId = ‘rbxassetid://11146777848’
PlayAnim = Character.Humanoid:LoadAnimation(Anim)

local TweenInfo = TweenInfo.new(1, Enum.EasingStyle.Sine)
local runGo = TweenService:Create(humanoid, TweenInfo, {WalkSpeed = 35})
local runStop = TweenService:Create(humanoid, TweenInfo, {WalkSpeed = 16})

UIS.InputBegan:connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftShift then
if Character.Humanoid.MoveDirection.Magnitude > 0 then
PlayAnim:Play()
runGo:Play()
for i = 1,5 do
game.Workspace.CurrentCamera.FieldOfView = (70+(i*2))
wait()
end
else
PlayAnim:Stop()
runStop:Play()
end
end
end)

UIS.InputEnded:connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftShift then
if Character.Humanoid.MoveDirection.Magnitude < 0 then
PlayAnim:Stop()
runStop:Play()
for i = 1,5 do
game.Workspace.CurrentCamera.FieldOfView = (80-(i*2))
wait()
end
else
PlayAnim:Stop()
runStop:Play()
end
end
end)

Please read the following post, How can I make a stamina bar that works with my sprint script?

I’ve read this, and some of the things are not what im looking for.

So, ive just made this just out of the mind it sorta works but doesnt have my walkspeed slowly turns down.

while true do
if running == true then
wait(5)
running = false
print(“out of stamina”)
PlayAnim:Stop()
runStop:Play()
for i = 1,5 do
game.Workspace.CurrentCamera.FieldOfView = (80-(i*2))
wait()
end
end
wait()
end