To use AHK with a Xim4 requires a Belkin Transfer Cable and the SandhawC app in the Xim Commander section.
Yes, you'll need to keep your Xim4 connected to PC, but it's not due to a USB port limitation as Xim4 supports USB hubs. It's simply to allow the Xim to detect m/kb connected to PC and allow interaction with PC software.