这句英语的语法问题

问题描述:

这句英语的语法问题
All he had to do was spend four months this year and next year in Moscow,a nice enough city,doing some research—which he would have done anyway at home at UCLA.
为什么这里要用would have done?可以用would
还有doing some research做什么成分,修饰的是spend还是four months?

would have done这里是虚拟用法.
就是说他就算不在莫斯科搞研究,也是要在美国搞的.而实情是已经决定在莫斯科搞了,所以就不需要在美国再做同样的事了.
spend some time doing something就是
spend four months doing research
明白了吗?我想问的是doing some research做什么成分,就是说做的是补语还是什么的spend some time doing something是习惯用法。可以理解为补语。就是补充说明花时间做些什么事。