All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
The ruling on working as a tax advisor depends on the type of taxes, as there as permissible taxes that are taken with a just cause when the treasury of the state and its resources are not sufficient to meet the public needs and so on. In this case, it is fair to take taxes in order to meet the needs and spend the money justly; it is not permissible to use trickery to avoid paying this type of taxes nor to help someone do so, whether one does it voluntarily or in return for a fee.
If a person undertakes legitimate means to reduce these permissible taxes without cheating, deceiving or fraud, and this requires exerting an effort, then there is nothing wrong in taking a commission from the one whom he alleviated the taxes for, as this is a lawful commission.
The second type of taxes are the prohibited taxes that are taken unjustly. There is no harm in working as an adviser in order to waive or reduce them, and to take a commission in return for doing so.
Finally, it should be noted that the fact that the commission is a percentage then this is forbidden according to the view of the majority of the scholars because it is an unknown amount, and they state that the commission must be a specified amount.
Allah knows best.