Is prayer nullified by having thoughts while performing it?
Prayer isn`t nullified by having thoughts while performing it, provided that the praying person offers all of its pillars and meets all of its conditions. However, the reward decreases significantly in the absence of reverence since a praying person is rewarded according to the attentiveness of his/her heart during prayer.
Is it permissible for one to masturbate in order not to commit fornication?
This is called committing the milder of the two evils such as eating a carcass in fear of death, and this happens when committing fornication is very likely to occur.
What is the ruling on aborting a fetus affected by thalassemia?
Praise be to Allah the Lord of the Worlds. May His peace and blessings be upon our Prophet Mohammad and upon all his family and companions.
If this is recommended by a trustworthy doctor who is god-fearing and knowledgeable, then it is permissible to have an abortion because some types of thalassemia are dangerous while some aren`t. And Allah The Almighty Knows Best.
Is it permissible to swear by (Allah "The Living")?
Yes, it is permissible because "The Living" is one of Allah`s Attributes.