Hello, I got here to help but as of now I haven't seen any code, so I can only make proposals.
Regarding the firing of a weapon, it can be done by emulating recharging based on the level of current engine energy level. If there is not enough energy, it just won't fire not matter how many times the buttons are hit. Since the energy level variable already exist this shouldn't be much of a problem, just need a new method.
Getloaded weapon can be done likewise by checking levels, but to prevent a lower level weapon to fire all the time a variable would be needed to simulate colling time. So it will make way for other weapons to be used.
Actually, using 'charging' the fired and getloaded can be merged to one
As to getting target information, this seems contradicting. For one you want the information, but it can only be true if a target was assigned either by the some AI chosing or by the player through a command/event. Without any assignment the answer could be anything the returned parameter has.