There are ~3 bigger mistakes seen in your 2 Replays.
1. You use way too much metal on different things in the first 3-5 min. Like using -35m/s while only having 10 m/s income.
-> only build 2-3 raiders in the beginning then focus on eco (no fac repeat until 3 min ingame, think what you really need)
-> cap 3 start mex + 3 solars -> 1 lotus then expand with com to next mex spot, if enemy raids you have enough time to build some units and you need early expansion and metal extractors.
2. You use your raiders ineffectively and sometimes cluster into riot units.
-> use your 2-3 raiders at start: 1 to scout the base and use the others to block the next possible mex spots for your enemys builders. Try to block enemy expansion before going into a push for victory.
3. Attacking > Defending
-> In mid game you allways use your units only to block enemy intruders. While this isn´t a bad thing in general, you give your enemy too much free space and unprotected mex. They only win because they outeco you having 60m/s+ while you have 20m/s.
-> use assault units vs riots and lotus protecting enemy mex, they can´t stop assaults like knight and you gain more space to build your own mex on their spots. Sometimes even 1 assault on a side lane can crush more then 7 mex (~14m/s) + 2lotus.
If you have more questions or replays you want to have analysed just pm me or ask for help again.