That's not a trivial task to do. In my opinion you would need some kind of queue data structure to save an arbitrary number of the last key presses. Therefore, you would wrap each key press to a command structure and store the commands in the queue. Your fighter would need a finite state machine to determine if the last key presses are relevant for the current state he's in.

There was a very old fighting game workshop for A5. I don't know if they used the same ideas but I think the workshop is available on Acknex Unlimited. Maybe you can find some inspiration there.