Just not too close because the landing field itself had heavy AA defenses.
Japanese AA, while dangerous, was nowhere near as dangerous as German AA. In part due to sheer numbers. The Japanese came nowhere near producing the amount of AA guns the Germans did. Granted they didn't have the East Front sinkhole to lose many of them in.
The Japanese light AA guns also just weren't that good. Small magazines, low rates of fire (and the small magazines meant practical rate of fire was much lower than the cyclic rate of fire)
manual traverse and elevation, poor sights, excessive vibration (especially on the multiple mounts).
Basically you had whatever RCMGs could be scrounged up and mounted on a pintle mount.
The Army had no heavy machine guns unless some airfields had some spare Ho-103 guns on crude mounts.
The Army had a single barrel 20mm gun in small numbers (2500 built during the war?) with a 20 round box magazine and a low rate of fire.
The Army then jumps to a 75mm AA gun.
The navy had the RCMGs plus the 13mm Hotchkiss guns. fired slower than a US ground .50 cal gun (about 7-8rps) and was fed with 30 round box magazines.
Then the Hotchkiss 25mm AA guns and a few old British 2pdr pompoms and copies. Then the usual 75mm type AA guns.
The US did loose quite a number of planes to Japanese AA fire but the numbers could have been much worse if the Japanese had even halfway decent 37-40mm guns in numbers.
Actual effective ranges for most of this stuff was a lot closer to 1000yds/meters than the book 3000-4000 meters. The shells would fly even further but the time of flight means your are trying to aim a number of seconds ahead of where the airplane is at those long ranges.