How would I make a combo system?

Hello, I want to make a combo system for a sword. I want it so if you spam left click, it plays animation a, b, and c, but if you don’t spam it, it only plays a. I’ve heard using tick(), but I’m confused on how to implement this. If I create a variable for tick() at the beginning of the script, it won’t register .5 seconds, or how long I want the window to be. Else if I make it in the function (im using ContextActionService to detect the left clicks), then I’ll only be able to access that once. If anyone is able to help me clear up these questions and lead me in the right direction I’d appreciate it. Thanks

Fairly certain you can just use Animation.IsPlaying to find if animation a is currently playing whenever mouse 1 is pressed, and then play animation b after animation a finishes.

pseudo-code

UserInputService.InputBegan:Connect(function(input)
    if input.Keycode = one then
        if animation1.IsPlaying then  -- check if animation 1 is currently playing
            animation1.Stopped:Wait()  -- wait until animation 1 stops
            animation2:play()
        end
    end
end)

I could but doing this doesn’t seem so efficient, to me anyways