A high court has scrapped a life prison term for a man and instead sentenced him to 25 years in prison for killing three of his relatives and attempting to murder a fourth in 2016.