Check the condition/charge of the battery and if need be, give it a full overnight charge.
Check the connectors going into the CJB (central junction box) for signs of water ingress (verdigris).
First thing to do, locate the “alarm chirp sounder” and disconnect it. This is the most common area for a drain. Also check that the flap in the ignition barrel is closing when the key is removed.
Welcome to the forum Coby. By all means carry out a full service but also check all he air hoses are tight, secure and free from leaks or damage. Above all, have the codes read as anything else is just guesswork.
If you are 100% sure the valves are opening and closing then the head will have to come off. I would suspect worn valve seats or piston rings leading to the lack of compression in the two cylinders.
Check the fuel pressure at the schrader valve at the fuel rail, should be in the region of 55psi. Next time it happens, disconnect the MAF sensor, if it then starts straight away then there is your problem.
First and foremost, charge the battery and then see what happens. You should also consider investing in a code reader, when you think how much they charge, having your own will pay for itself after the first use.
If it’s not behind the headlight then look at the one in the driver’s side wheel well, it may well be close to falling off.
It should be at 12’o clock on the frame behind the wheel.
These may help, if not, just look on the same site as they are free.
http://www.jagrepair.com/images/Electrical/Elect-Tech All2/87 - 88 XJ6 Series III XJS Electrical.pdf
http://www.jagrepair.com/images/Electrical/Elect-Tech All2/90 Sedan Electrical.pdf
The more you drive it the more charge will go into the battery. The fact you now have no warnings is proof of low voltage. Before you go spending on a new battery, give your existing one a full charge. If it still loses voltage then by all means replace it.