The slave polls for changes. Thats why you have to edit the library only on the slave server.
The slave gets added to the master server by the ispconfig installer while the slave gets installed, so you dont add anything in ispconfig on the master server and you can not add anything there, as this would not result in a working setup.
All mysql hostnames except of localhost have to be FQDN. So "slave" is not a valid hostname for that setup as the systm tries to resolve the names, you can e.g. use slave.yourdomain.tld instead.
Please be aware that ispconfig has to connect to the mysql db on localhost for its own purposes, so you can not change the IP address for localhost to a different IP in /etc/hosts.
I guess you will have to extend the settings in config.inc.php so that you can set the mysql port there to a different port for the master and the slave connection and then change the mysql library to use the default port for the local connection and the otherv port for the remote connection.