Since you have a key which will open the helmet lock, then remove the helmet lock. The phillips head screw behind it has blue locktite, so it's a good idea to hit it with some heat. It won't take a lot, but if you don't, there's a good chance you'll strip out the head. The code will be on the back side of the lock body, no need to hack anything apart. Bring that lock, the key which work with it, and know the year, make and model. A good locksmith shouldn't charge you any more than 30 bucks or so to code cut a perfect key. If that is still not working in the cap, then you need to lube up the cap. Remember to push down on the cap when turning the key, this gets the pressure of the lock mechanism and allows it to turn easier.
1990 EX500 - 141,000 miles as of June 30th, 2019
1993 Ducati 900SS - The real canyon carver
2002 EX500 - Undergoing a full restoration