you need to make a counter for charged shots. The action of shooting is executed when you're not pressing a particular key. But you'd also need to limit that within the value of a counter so that you're not ALWAYS shooting.
1) when X is pressed constantly, +1 to counter
2) when X is not pressed, while counter is >10, shoot charged shot, limit action to 1 if it loops. Set counter to 0
That's the gist of it. It can become a bit buggy depending on how the loop is defined and how the engine resets the counter.