so if i install a new version of TWRP and reinstall the rom... this will fix the problem???
The problem with the WiFi is most probably with your firmware, that was the reason you were asked to getvar etc. Older firmware caused the WiFi to be not working.
So, you should update to new version of TWRP and see if you have the latest firmware. If you have already, the problem lies somewhere else. If you do not have the latest, your task is to update to latest firmware (MM).
Thus the question is, are you s-on or s-off?
If you're the latter, get the latest firmware and flash.
If you're s-on, then you need to rollback to original software (OS and recovery), perform OTA update, and come back to custom rom again.