The minimization of thermodynamic potentials does not refer to the minimization of the thermal equation of state as function of its explicit variables. Instead it refers to the result of an interaction of the system with its environment.
For example, imagine you have two systems that are isolated from each other and their common environment both are in equilibrium having $S_1$ and $S_2$ entropies, resp. Now let them interact but stay still isolated from the environment, then the 2nd law says then when they reach common equilibrium with each other then the total entropy $S_0$ will not decrease, i.e, $S_1+S_2 \le S_0$ This is what maximum entropy means in this: equilibrium is achieved at the maximum of the total entropy.
Now take a system that is in equilibrium and isolated form its environment having free energy $A_0$. Now let this system interact only with an entropy ("heat") reservoir at a fixed temperature $T_1$. Wait until the system reaches equilibrium with the reservoir now both at $T_1$ by exchanging some amount of entropy with it. Now the new free energy of the system will not exceed its initial, ie., $A_1 \le A_0$. In other words, the thermal equilibrium of the system with its environment is reached when the free energy is minimum.