I think that there is some infection of your stomach that is affecting the liver
function. It can also be auto-immune or rheumatological cause. Try to get some blood tests done. Do not take unnecessary medication especially antibiotics as medicines can affect liver. Try taking hygienic food and clean drinking water. Increase fiber in your diet. Take more of fruits and vegetables.