Hi, welcome to JA.
Commonly, if you unplug the MAF sensor and the vehicle runs, it's a faulty MAF sensor. When you plug the MAF in while the engine is running the ECM is not using those values until the ignition is again shut off. However, there are other possibilities, such as a faulty ECM, or an air leak in the intake system causing the MAF values to become inaccurate. The correct method to approach this problem, would be to begin by scanning the ECM with a generic OBD 2 scan tool. If there are codes stored, clear them and attempt to run the engine multiple times to recreate a code. If the MAF code reappears with the sensor connected, than you need to utilize a smoke machine to locate any leaks between the MAF and the intake or vacuum leaks in the intake itself. No leaks and we could use a lab scope to test the MAF signals to the ECM to verify which one has failed. Since you may not have access to all this equipment, also try keeping your foot on the gas to keep it running and have an assistant listen for any odd air leaks, such as a sucking sound. You can also purchase generic OBD 2 scan tools from most auto part stores for around $100. This scan tool may be valuable later down the road and will work on any 1996 and newer cars, so a great investment for the do-it-yourself.
Forgive me, but what does ECM stand for? I'm a weekend warrior when it comes to mechanics. Thanks.