Stop Function if key is no longer held down?

So I’ve made a drift boost system for my game however I’ve run into a handful of issues

  1. Pressing the button for a split second executes the build up script towards the eventual boost even though I want it to be held down in order for it to carry out the task

  2. my input ended doesn’t do much other than cleaning up what was previously mentioned

Basically I wanna make it so in the event a player stops holding down the button the function ends in the part they’re on and not carry on.

UserInputService.InputEnded:Connect(function(Hotkey,GPE)
	if GPE then return end
	if Hotkey.KeyCode == Enum.KeyCode.J and Drift then
		Drift = false
		MiniTurbo = false
		SuperTurbo = false
		STFxL.Enabled = false
		STFxR.Enabled = false
		MTFxL.Enabled = false
		MTFxR.Enabled = false
		CanBuild = false
		DriftDirection = "None"
		print("Drifting Has Stopped")
		task.wait(0)
	end
	
end)



--Drift Boost Related Stuff
UserInputService.InputBegan:Connect(function(Hotkey,GPE)
	if GPE then return end
	if Hotkey.KeyCode == Enum.KeyCode.J and Drift then
		Drift = true
		DriftDirection = "None"
		print("Drifting Turbo Build Begin")
		print("Building MiniTurbo")
		task.wait(2.25)
		print("MiniTurbo Built")
		MTFxL.Enabled = true
		MTFxR.Enabled = true
		print("Building SuperTurbo")
		MiniTurbo = true
		SuperTurbo= false
		task.wait(4.75)
		print("Super Turbo Built")
		MiniTurbo = false
		MTFxL.Enabled = false
		MTFxR.Enabled = false
		SuperTurbo = true
		STFxL.Enabled = true
		STFxR.Enabled = true
		task.wait(0)
	end
end)

any help or ideas would be greatly appreciated.