The short answer to your question is yes. Most things that you ingest are going to effect your liver in some way. In this case, the particular chemical is called psilocybin. While the effects that a person feels from this chemical are mainly found in the brain, it is processed by the liver.
When the psilocybin passes through the digestive system and into the liver, it is changed into psilocin, the active tryptamine compound (a crystalline compound of carbon, hydrogen, and nitrogen that is made in plant and animal tissues).
It is only after these and other digestive processes are complete that a person will begin the feel the effects of the drug and its interaction with their brain chemistry. Since it appears that you have a medical condition involving your liver function, you may want to ask your doctor about this and any other such things you might consider taking.