You need to program each device separately, then hook them up together.
I would leave the J-PAC with the default setup MAME setup for players 1 and 2.
Hook the JPAC up to the video (so you can see what you're doing), but leave it disconnected from the PC keyboard port. Hook up the IPAC2 directly to the PC, run winipac and program the IPAC2 for players 3 and 4, avoiding keys that are used by the default programming on the J-PAC.
The toughest part should really be figuring out what keys to use.