Well doing all of it, is a bit difficult, would require 3 seperate scripts / commands in my opinion.
Anyway, to get the channels topic, and save it in a variable, you could use something like this
alias Get-Topic {
set %channel-topic $chan($active).topic
echo -s Topic is %channel-topic
}
Usage:
/Get-Topic
In the channel where you want to get the topic from.
Currently it will return the topic in the status window, just to visualise it, you could take that part out as well.
To remove the first word, some letter or some part, read up on:
$gettok
$left
$mid
$len
Or specify what you actually want with the topic.
Good luck.