And of course, most CAS/attack aircraft used by the RAF and USAAF weren't originally designed for the role. The P-47 was an interceptor turned escort fighter. Merlin Spitfires were originally interceptors or local air superiority fighters. The Typhoon was an interceptor turned Jabo interceptor. Even the A-36 was basically an early P-51 with some mods to make it a dual role low alt. fighter and dive bomber rather than a pure fighter.
The only "pure" attack type aircraft the Brits used were used by the Royal Navy, and it seems that both the RAF and USAAF gave up on the idea of purpose built attack or CAS aircraft. A USAAF memo on the matter basically suggested that purpose built attack aircraft were often useless without air superiority or air supremacy. And favoring fighter bombers and fast bomber/attack planes.
But I do have to ask, what's the difference (by World War II standards) between CAS, ground attack and army cooperation?
At the start of WWII the main RAF Army Cooperation role was originally filled by the Lysander. Army Cooperation = realtime/near realtime reconnaissance & communication with ground units, observation & artillery direction, night-time flare dropping/target marking, etc. As time went by the RAF used faster and more survivable aircraft (at least for the day-time missions), hence the use of the Mustang in the role as one example.
CAS is usually defined as using the weapons on the aircraft for attacking enemy units close to friendly units - ie on the battle line. CAS aircraft in WWII did not (I think) usually act as observers for artillery, but would often work with ground-based FACs of one sort or another. By mid-war the UK (for example) had specialized OP tanks that filled the roll of artillery spotting and FACs, as well as infantry teams for artillery spotting and FAC.
GA is usually more general in nature. Aircraft assigned to attack point targets (ie railroad trains, bridges, airfields, V-1 launch sites, enemy troop concentrations, etc) which may or may not be close to the battle line and not engaged with friendly units, are usually considered GA missions as opposed to CAS or Army Cooperation missions.
Who says the P-38 was really good at CAS? The P-38 had a serious problem relative to that mission, or any other that involved looking at the ground. The visibility from the cockpit forward and down was exceptionally poor. The long nose ahead, the two massive cowlings on either side and the broad wing on either side of the cockpit and the nose landing gear location preventing a belly window installation, combined to be a problem even for photo recon missions. The 9th PRS in India even tried to rig up a kind of a periscope to enable the pilot to line up with the target. Seeing the ground was not a design consideration for the P-38's original interceptor mission. The P-38 was not used very much for CAS, mainly because of the urgent need for high altitude escort in the ETO and the airplane's popularity in the Pacific.
No, the P-82 was not a "replacement" for the P-38. Like the P-61E, it was designed to handle the problem of very long range escort for the B-29's attacking Japan from Saipan. The P-51 had the range from Iwo Jima when it was captured, but flying from the Marianas, range or not, pilots could not stay awake for that long.