Off the top of my head, this is how i'd do it.
I would create an array
Keypresses(4,1)
This would store the last 5 (0 through 4) keys pressed and the times at which they had been pressed. Lets say that you want the combination 'qqa' done in less then 2 seconds (for arguments sake let's pretend the scancode of q=100 and the scancode of a=200) Then, unless I am mistaken, all you needed to do was ...
if Keypresses(2,0)=100 and keypresses(3,0)=100 and keypresses(4,0)=200 and keypresses(4,1)-keypresses(2,1)<2000 then
..... Do whatever you want.....
endif
what this does is check wether the last three keys pressed was qqa (in that order) and subtracts the time of the youngest key press from the oldest key press to check if it took less then 2 seconds (2000 miliseconds) for them to be pressed. You can do as many combinations as you like up to 5 keys but bear in mind that a combination of 'qqa' and a 'zqqa' would probably conflict with each other.
Hope this was helpfull.
Take care
AtomR