Implement Custom Transpose

I want to use gig performer scripting to implement custom transpose feature

  1. Pressing cc x1 and x2 together (cc pressed down) should reset the global transpose
  2. Pressing and holding x1 and x2 plus any note on the keyboard should transpose the global transpose to that key relative to F
    a) So pressing x1 and x2 and hitting F# should set global transpose to +1
    b) For keys F# through A, I want them to be transposed positively and otherwise negatively

Any help on scripting this would be appreciated. Thanks in advance!!