RPG like abilities system

Hey, I tried something similar.

I am working on an RTS-Type template and thought about a system to give different units of class “Unit” different skills.

Instead of coding all the skills in the particular “Unit” i wanted to do a main class “Skill” and child classes of it like “Skill_SelfDestroy” or “Skill_Sprint”.

Then back in the “Unit” class i wanted to set an struct array whereas the struct contains a “Key” and a class of “Skill”.

For example at index 0 → “X”; “Skill_SelfDestroy”.

So at any KeyPress I check the struct array for an equal “Key” and get the “Skill” class.
The problem then is, that i cant really call a class. i would have to spawn or constrct it first and call the Reference which feels a bit clumpy.

Also im not sure which class i should use as Parent class of “Skill”.
“Actor” seems overkill, i tried “Object” but this does have to much limitations like it cant use Function Libraries and does not have any Tick events. I tried “Actor Component” aswell but i cant spawn them at runtime…

I tried a lot and all I know by now is what does not work. sigh