Need help w combo script

i have made a 4-hit combo and after the 4th m1 it’s supposed to go on cooldown for 2 seconds so you cant just spam m1 but instead it breaks and you can’t m1 anymore, i’ve tried to fix it but it does that or only plays the 1st m1 animation repeatedly

here is my code

local rp = game:GetService("ReplicatedStorage")
local remotes = rp:WaitForChild("Remotes")

local combatRemote = remotes:WaitForChild("Combat")

local animations = rp:WaitForChild("Animations")
local combatAnims = animations:WaitForChild("Combat")

local Players = game:GetService("Players")

local MAX_COMBO = 4

Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(char)
		char:SetAttribute("Combo",0)
	end)
end)

local function changeCombo(char)
	local combo = char:GetAttribute("Combo")
	
	if combo < MAX_COMBO then
		char:SetAttribute("Combo",combo + 1)
	else
		char:SetAttribute("Combo",1)
	end
end


local function getAnimation(char)
	local combo = char:GetAttribute("Combo")
	
	local anims = combatAnims:GetChildren()
	
	local currAnim = anims[combo]
	
	return currAnim
end

combatRemote.OnServerEvent:Connect(function(player)
	local char = player.Character
	local hum = char:WaitForChild("Humanoid")
	local humRp = char:WaitForChild("HumanoidRootPart")
	
	local animator = hum:FindFirstChildOfClass("Animator") or Instance.new("Animator",hum)
	
	local attacking = char:GetAttribute("Attacking")
	local punching = char:GetAttribute("Punching")
	
	print("Punch Easy")
	
	if attacking or punching then return end
	
	char:SetAttribute("Attacking",true)
	char:SetAttribute("Punching",true)
	
	changeCombo(char)
	
	local punchAnim = getAnimation(char)
	local playAnimation = animator:LoadAnimation(punchAnim)
	
	playAnimation.KeyframeReached:Connect(function(kf)
		if kf == "Hit" then
			task.wait(0.25)
			char:SetAttribute("Attacking",false)
			
			if char:GetAttribute("Combo") == MAX_COMBO then --where it breaks
				task.wait(2)
			end
			
			char:SetAttribute("Punching",false)
		end
	end)
	
	playAnimation:Play()
	
end)