It's been years since I've seen anything like this. Those first two pics are enough to cause Flashbacks
A pretty inventive solution to the Skylight leak there...
I too am wondering where that tube goes...
Maybe it waters some plants somewhere? Or, goes into the Coffeemaker downstairs?
Bill