I'm no expert, but should:

right_key = my.skill1&0x00000006;

be

right_key = my.skill1&0x00000008;

Just for someone trying to grab all this code, as a beginner it may be confusing. (Reason, powers of two are used to store these numbers on top of each other like this)

-Don
have a great day