How to implement a functional timer into this combo system

I tried grasping using tick but I’m not quite sure how to pull it off without preventing the first 3 Values in my table from showing nil as soon as a button is pressed.

local newtab = {}
local timer = tick()


UIS.InputBegan:Connect(function(inp,gpe)
	if inp.UserInputType == Enum.UserInputType.Keyboard or inp.UserInputType == Enum.UserInputType.MouseButton1 and not gpe then
		if #newtab < 3 then
			if inp.UserInputType == Enum.UserInputType.Keyboard then
		table.insert(newtab,inp.KeyCode)
		wait(.3)
			elseif inp.UserInputType == Enum.UserInputType.MouseButton1 then
				table.insert(newtab, inp.UserInputType)
				wait(.3)
			end
		if newtab[1] == Enum.UserInputType.MouseButton1 and newtab[2] == Enum.UserInputType.MouseButton1 and newtab[3] == Enum.UserInputType.MouseButton1 then
			print'SwordCombo'
		end
		else 
			table.remove(newtab, 1)
			table.remove(newtab, 2)
			table.remove(newtab, 3)
		end
		print(newtab[1],newtab[2],newtab[3])
	end
end)