Skill tree

I have the general idea of the skill tree and I know how to make it but how do I make it so when I click on a skill it levels me up to that skill? EX: in the logic bricks to level up running shift and w and running2 --> motion = 0.3

Store the skill in a property (or state).
When you change the property you run logic that changes some of the other logic (e.g. increasing run speed parameter, enabling jumping)