Negative of the $\Delta G$ for a process is the maximum useful work that can be obtained from it (at constant pressure and temperature). I understood this in this way: $\Delta H$ is the heat absorbed by the system (since the process is at constant temperature and pressure), so equivalently $-\Delta H$ energy is obtained from the system after doing expansion work. Since $\Delta S$ is the entropy created in the process, at the very least $-\Delta S$ entropy must be created in the surroundings - that is, at least $-T\Delta S$ energy must be lost as heat. This comes from the $-\Delta H$, and thus leaves $-\Delta H + T\Delta S$ to do useful work. No more work can be done than this. $-\Delta H + T\Delta S$ is $-\Delta G$, so $-\Delta G$ is the maximum possible useful work. First of all, I wanted to know if this is correct, and if this is actually why $-\Delta G$ is the maximum possible useful work.
Now if $|\Delta H|$ is more than $|T\Delta S|$, with both being negative, then one can think of the $W_{max}$ or $-\Delta G$ as a part of the $|\Delta H|$; since $|\Delta G|< |\Delta H|$. Some part of $|\Delta H|$ goes as $|T\Delta S|$ to increase the surroundings' entropy, and the other part in doing useful work. But if both are positive, with $|T\Delta S|$ being more than $|\Delta H|$, again $\Delta G$ is negative, allowing useful work to be extracted. But now it seems as though $|T\Delta S|$ heat will be extracted from the surroundings, $|\Delta H|$ used up in the process, while the rest can be converted to work - in other words, useful work is a part of $|T\Delta S|$ - with the other part used by the process as $|\Delta H|$. Is this correct? Is $|T\Delta S|$ extracted from the surroundings actually?